diff options
author | Andrey Kurilin <akurilin@mirantis.com> | 2016-02-10 16:05:48 +0200 |
---|---|---|
committer | Andrey Kurilin <akurilin@mirantis.com> | 2016-02-16 16:20:41 +0200 |
commit | 1d1e43957dc785231c50a105229814b06eb74752 (patch) | |
tree | 038b07488e1cd800d50556efbe01e1eb3e243c31 /novaclient/exceptions.py | |
parent | 99c588e28c2c4eb0b684cfd54d79d76fc30197fe (diff) | |
download | python-novaclient-1d1e43957dc785231c50a105229814b06eb74752.tar.gz |
[microversions] Add support for 2.19
2.19 - Allow the user to set and get the server description. The user will
be able to set the description when creating, rebuilding, or updating
a server, and get the description as part of the server details.
Methods `rebuild` and `create` of novaclient.v2.servers.ServerManager were
not wrapped with `api_versions.wraps` decorator to reduce code and docsting
duplication. Version checks added inside these methods.
Change-Id: I75b804c6edd0cdf02c2cd002d0b5968fec8da545
Diffstat (limited to 'novaclient/exceptions.py')
-rw-r--r-- | novaclient/exceptions.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/novaclient/exceptions.py b/novaclient/exceptions.py index b9bdf114..c502e964 100644 --- a/novaclient/exceptions.py +++ b/novaclient/exceptions.py @@ -24,6 +24,24 @@ class UnsupportedVersion(Exception): pass +class UnsupportedAttribute(AttributeError): + """Indicates that the user is trying to transmit the argument to a method, + which is not supported by selected version. + """ + + def __init__(self, argument_name, start_version, end_version=None): + if end_version: + self.message = ( + "'%(name)s' argument is only allowed for microversions " + "%(start)s - %(end)s." % {"name": argument_name, + "start": start_version, + "end": end_version}) + else: + self.message = ( + "'%(name)s' argument is only allowed since microversion " + "%(start)s." % {"name": argument_name, "start": start_version}) + + class CommandError(Exception): pass |