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/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.idea
|
||||
.cache
|
||||
.stestr/
|
||||
coverage.xml
|
||||
|
@ -535,6 +535,10 @@ class ScaleInCluster(command.Command):
|
||||
|
||||
resp = senlin_client.scale_in_cluster(parsed_args.cluster,
|
||||
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:
|
||||
print('Request accepted by action: %s' % resp['action'])
|
||||
else:
|
||||
@ -566,6 +570,10 @@ class ScaleOutCluster(command.Command):
|
||||
|
||||
resp = senlin_client.scale_out_cluster(parsed_args.cluster,
|
||||
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:
|
||||
print('Request accepted by action: %s' % resp['action'])
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user