Update client to account for 409 error in cluster actions
This patch allows the senlin client to properly parse a 409 error when a scaling action fails due to a conflict or cooldown Depends-On: https://review.openstack.org/585573 Change-Id: I2fff7c2cc1bb17c0e32ef5b67294b811aff22192
This commit is contained in:
parent
162c5c289a
commit
87b7b13ea9
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.cluster_scale_in(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.cluster_scale_out(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