Merge "Update client to account for 409 error in cluster actions"
This commit is contained in:
commit
6ec11214e9
2
.gitignore
vendored
2
.gitignore
vendored
@ -38,6 +38,8 @@ cover/
|
|||||||
htmlcov/
|
htmlcov/
|
||||||
.tox/
|
.tox/
|
||||||
.coverage
|
.coverage
|
||||||
|
.coverage.*
|
||||||
|
.idea
|
||||||
.cache
|
.cache
|
||||||
.stestr/
|
.stestr/
|
||||||
coverage.xml
|
coverage.xml
|
||||||
|
@ -535,6 +535,10 @@ class ScaleInCluster(command.Command):
|
|||||||
|
|
||||||
resp = senlin_client.scale_in_cluster(parsed_args.cluster,
|
resp = senlin_client.scale_in_cluster(parsed_args.cluster,
|
||||||
parsed_args.count)
|
parsed_args.count)
|
||||||
|
status_code = resp.get('code', None)
|
||||||
|
if status_code in [409]:
|
||||||
|
raise exc.CommandError(_(
|
||||||
|
'Unable to scale in cluster: %s') % resp['error']['message'])
|
||||||
if 'action' in resp:
|
if 'action' in resp:
|
||||||
print('Request accepted by action: %s' % resp['action'])
|
print('Request accepted by action: %s' % resp['action'])
|
||||||
else:
|
else:
|
||||||
@ -566,6 +570,10 @@ class ScaleOutCluster(command.Command):
|
|||||||
|
|
||||||
resp = senlin_client.scale_out_cluster(parsed_args.cluster,
|
resp = senlin_client.scale_out_cluster(parsed_args.cluster,
|
||||||
parsed_args.count)
|
parsed_args.count)
|
||||||
|
status_code = resp.get('code', None)
|
||||||
|
if status_code in [409]:
|
||||||
|
raise exc.CommandError(_(
|
||||||
|
'Unable to scale out cluster: %s') % resp['error']['message'])
|
||||||
if 'action' in resp:
|
if 'action' in resp:
|
||||||
print('Request accepted by action: %s' % resp['action'])
|
print('Request accepted by action: %s' % resp['action'])
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user