Skip to content

Commit

Permalink
[CLI] Initialize cloud layer in CCE and RDS (#159)
Browse files Browse the repository at this point in the history
[CLI] Initialize cloud layer in CCE and RDS

Description
Add SDK loading to sdk_connection in DeleteCCECluster.take_action
Resolve #151
Resolve #160

Reviewed-by: Artem Goncharov <[email protected]>
Reviewed-by: None <None>
  • Loading branch information
outcatcher authored Apr 12, 2021
1 parent 388cebf commit 1502247
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions otcextensions/osclient/cce/v2/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ def take_action(self, parsed_args):
if not parsed_args.wait:
attrs['wait'] = False

# initialize sdk_connection with cce methods
_ = self.app.client_manager.cce
if parsed_args.cluster:
self.app.client_manager.sdk_connection.delete_cce_cluster(
**attrs
Expand Down Expand Up @@ -234,6 +236,8 @@ def take_action(self, parsed_args):
if parsed_args.multi_az:
attrs['az'] = 'multi_az'

# initialize sdk_connection with cce methods
_ = self.app.client_manager.cce
obj = self.app.client_manager.sdk_connection.create_cce_cluster(
**attrs)

Expand Down
5 changes: 5 additions & 0 deletions otcextensions/osclient/rds/v3/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ def get_parser(self, prog_name):

def take_action(self, parsed_args):
# Attention: not conform password result in BadRequest with no info

# initialize sdk_connection with rds methods
_ = self.app.client_manager.rds
client = self.app.client_manager.sdk_connection
attrs = {}
for attr in [
Expand Down Expand Up @@ -407,6 +410,8 @@ def get_parser(self, prog_name):
return parser

def take_action(self, parsed_args):
# initialize sdk_connection with rds methods
_ = self.app.client_manager.rds
client = self.app.client_manager.sdk_connection
attrs = {}
for attr in [
Expand Down

0 comments on commit 1502247

Please sign in to comment.