diff --git a/.gitignore b/.gitignore index b2ea2049..aab8db3b 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,8 @@ cover/ htmlcov/ .tox/ .coverage +.coverage.* +.idea .cache .stestr/ coverage.xml diff --git a/senlinclient/v1/cluster.py b/senlinclient/v1/cluster.py index cbfa15af..0ba2fd2a 100644 --- a/senlinclient/v1/cluster.py +++ b/senlinclient/v1/cluster.py @@ -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: