diff options
| author | Jenkins <jenkins@review.openstack.org> | 2014-12-15 15:55:58 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2014-12-15 15:55:58 +0000 |
| commit | 0cdc947bf998c7f00a23c11bf1be4bc5929b7803 (patch) | |
| tree | 8e155e362465a7e7c8828abee977c271e024cefd | |
| parent | 385d97ef38fd7b976ea24653a2b4514dee62ffb8 (diff) | |
| parent | 8e8dde2052148fea0135a19ad229da7114738024 (diff) | |
| download | python-glanceclient-0cdc947bf998c7f00a23c11bf1be4bc5929b7803.tar.gz | |
Merge "Output clear error message on invalid api version"
| -rw-r--r-- | glanceclient/shell.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/glanceclient/shell.py b/glanceclient/shell.py index 4460766..31891e6 100644 --- a/glanceclient/shell.py +++ b/glanceclient/shell.py @@ -597,7 +597,11 @@ class OpenStackImagesShell(object): url_version = None # build available subcommands based on version - api_version = int(options.os_image_api_version or url_version or 1) + try: + api_version = int(options.os_image_api_version or url_version or 1) + except ValueError: + print("Invalid API version parameter") + utils.exit() if api_version == 2: self._cache_schemas(options) |
