diff options
| author | Jenkins <jenkins@review.openstack.org> | 2015-04-14 22:05:31 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2015-04-14 22:05:31 +0000 |
| commit | 520cae655ed603b4bcb963f8ef49b3b6074c5fef (patch) | |
| tree | 1de7f0538f2b015a178c0dbcb937aca91c7af311 /openstackclient | |
| parent | e60bf28ae3bdb34b65316249f0e7615048aa1f95 (diff) | |
| parent | a0fe37e189948b74ee8c2f8ec529ca175efc8449 (diff) | |
| download | python-openstackclient-520cae655ed603b4bcb963f8ef49b3b6074c5fef.tar.gz | |
Merge "Add warning message if unknown version supplied"
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/compute/client.py | 3 | ||||
| -rw-r--r-- | openstackclient/shell.py | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/openstackclient/compute/client.py b/openstackclient/compute/client.py index 7ca08a4f..bdba4dca 100644 --- a/openstackclient/compute/client.py +++ b/openstackclient/compute/client.py @@ -30,6 +30,9 @@ LOG = logging.getLogger(__name__) DEFAULT_COMPUTE_API_VERSION = '2' API_VERSION_OPTION = 'os_compute_api_version' API_NAME = 'compute' +API_VERSIONS = { + "2": "novaclient.client", +} def make_client(instance): diff --git a/openstackclient/shell.py b/openstackclient/shell.py index 3cfd7312..ebc80c2a 100644 --- a/openstackclient/shell.py +++ b/openstackclient/shell.py @@ -247,6 +247,11 @@ class OpenStackShell(app.App): if version_opt: api = mod.API_NAME self.api_version[api] = version_opt + if version_opt not in mod.API_VERSIONS: + self.log.warning( + "The %s version <%s> is not in supported versions <%s>" + % (api, version_opt, + ', '.join(mod.API_VERSIONS.keys()))) # Command groups deal only with major versions version = '.v' + version_opt.replace('.', '_').split('_')[0] cmd_group = 'openstack.' + api.replace('-', '_') + version |
