Skip to content

Commit

Permalink
CCE client fixes due to changes on cloud layer (#186)
Browse files Browse the repository at this point in the history
CCE client fixes due to changes on cloud layer

Reviewed-by: None <None>
Reviewed-by: Rodion Gyrbu <[email protected]>
  • Loading branch information
tischrei authored Jun 10, 2021
1 parent 35080fb commit d78ae59
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
13 changes: 7 additions & 6 deletions otcextensions/osclient/cce/v2/cluster_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ def get_parser(self, prog_name):
help=_('Maximum number of pods on the node')
)
parser.add_argument(
'--network-id',
metavar='<network_id>',
'--network',
metavar='<network>',
required=True,
help=_('ID of the network where the node will be created.')
help=_('ID or name of the network where the node will be '
'created.')
)
parser.add_argument(
'--node-image-id',
Expand Down Expand Up @@ -398,7 +399,7 @@ def take_action(self, parsed_args):
attrs['cluster'] = parsed_args.cluster
attrs['count'] = parsed_args.count
attrs['flavor'] = parsed_args.flavor
attrs['network_id'] = parsed_args.network_id
attrs['network'] = parsed_args.network
attrs['ssh_key'] = parsed_args.ssh_key

# optional
Expand Down Expand Up @@ -428,8 +429,8 @@ def take_action(self, parsed_args):
attrs['max_pods'] = parsed_args.max_pods
if parsed_args.name:
attrs['name'] = parsed_args.name
if parsed_args.network_id:
attrs['network_id'] = parsed_args.network_id
if parsed_args.network:
attrs['network'] = parsed_args.network
if parsed_args.node_image_id:
attrs['node_image_id'] = parsed_args.node_image_id
if parsed_args.os:
Expand Down
8 changes: 4 additions & 4 deletions otcextensions/osclient/cce/v2/node_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@ def get_parser(self, prog_name):
help=_('Additional public key to be added to for login.')
)
parser.add_argument(
'--network-id',
metavar='<network_id>',
'--network',
metavar='<network>',
required=True,
help=_('ID of the network to which the cluster node '
help=_('ID or name of the network to which the cluster node '
'will belong to.')
)
parser.add_argument(
Expand Down Expand Up @@ -359,7 +359,7 @@ def take_action(self, parsed_args):
attrs['flavor'] = parsed_args.flavor
attrs['os'] = parsed_args.os
attrs['name'] = parsed_args.name
attrs['network_id'] = parsed_args.network_id
attrs['network'] = parsed_args.network
attrs['ssh_key'] = parsed_args.ssh_key

# optional
Expand Down
6 changes: 3 additions & 3 deletions otcextensions/tests/unit/osclient/cce/v2/test_cluster_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_create(self):
'--flavor', 'flvr',
'--label', 'l1=v1',
'--label', 'l2=v2',
'--network-id', 'nw',
'--network', 'nw',
'--root-volume-size', '230',
'--root-volume-type', 'SATA',
'--ssh-key', 'key',
Expand All @@ -105,7 +105,7 @@ def test_create(self):
{'volumetype': 'SAS', 'size': '200'}]),
('flavor', 'flvr'),
('labels', {'l1': 'v1', 'l2': 'v2'}),
('network_id', 'nw'),
('network', 'nw'),
('root_volume_size', 230),
('root_volume_type', 'SATA'),
('ssh_key', 'key'),
Expand All @@ -127,7 +127,7 @@ def test_create(self):
cluster='cluster_name',
count=12,
flavor='flvr',
network_id='nw',
network='nw',
ssh_key='key',
annotations={'a1': 'v1', 'a2': 'v2'},
bandwidth=30,
Expand Down
6 changes: 3 additions & 3 deletions otcextensions/tests/unit/osclient/cce/v2/test_node_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def test_create(self):
'cluster_name',
'pool_name',
'--flavor', 'flav',
'--network-id', 'nw',
'--network', 'nw',
'--os', 'CentOS',
'--ssh-key', 'sshkey'
]
Expand All @@ -343,7 +343,7 @@ def test_create(self):
('az', 'random'),
('flavor', 'flav'),
('initial_node_count', 0),
('network_id', 'nw'),
('network', 'nw'),
('os', 'CentOS'),
('root_volume_size', 40),
('root_volume_type', 'SATA'),
Expand All @@ -366,7 +366,7 @@ def test_create(self):
cluster='cluster_name',
flavor='flav',
name='pool_name',
network_id='nw',
network='nw',
os='CentOS',
root_volume_size=40,
root_volume_type='SATA',
Expand Down

0 comments on commit d78ae59

Please sign in to comment.