diff options
author | ashish-kumar-gupta <ashish-kumar.gupta@hpe.com> | 2016-10-07 11:45:42 +0530 |
---|---|---|
committer | ashish-kumar-gupta <ashish-kumar.gupta@hpe.com> | 2016-10-07 12:11:08 +0530 |
commit | 647bf3838471553490858e73a10f8ec550956eaa (patch) | |
tree | 838f1eac4b3d0d3ef5ab7c5020204a3bd4ceb7d4 | |
parent | d2d357dccf5142c64ad0eddcaf6aeaa405b765e1 (diff) | |
download | python-designateclient-647bf3838471553490858e73a10f8ec550956eaa.tar.gz |
Fix for message for quota limit in designate-clientmitaka-eolstable/mitaka
Current designate-client code doesnot handle the REST response for over-quota
Change-Id: I6eb1d2d8b5c2fdca594ad7dd0770ee20dab7e769
Closes-Bug: #1629222
-rw-r--r-- | designateclient/v2/cli/recordsets.py | 4 | ||||
-rw-r--r-- | designateclient/v2/cli/zones.py | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/designateclient/v2/cli/recordsets.py b/designateclient/v2/cli/recordsets.py index fc0f29a..255e4b3 100644 --- a/designateclient/v2/cli/recordsets.py +++ b/designateclient/v2/cli/recordsets.py @@ -19,6 +19,7 @@ import logging from cliff import command from cliff import lister from cliff import show +from openstackclient.common import exceptions as osc_exc import six from designateclient import utils @@ -141,6 +142,9 @@ class CreateRecordSetCommand(show.ShowOne): description=parsed_args.description, ttl=parsed_args.ttl) + if data['code'] == 413: + msg = "Quota limit reached for recordset creation" + raise osc_exc.CommandError(msg) _format_recordset(data) return six.moves.zip(*sorted(six.iteritems(data))) diff --git a/designateclient/v2/cli/zones.py b/designateclient/v2/cli/zones.py index 465c3ed..6751f1f 100644 --- a/designateclient/v2/cli/zones.py +++ b/designateclient/v2/cli/zones.py @@ -143,6 +143,9 @@ class CreateZoneCommand(show.ShowOne): data = client.zones.create( parsed_args.name, parsed_args.type, **payload) + if data['code'] == 413: + msg = "Quota limit reached for domain creation" + raise osc_exc.CommandError(msg) _format_zone(data) return six.moves.zip(*sorted(six.iteritems(data))) |