diff options
| author | Takeaki Matsumoto <takeaki.matsumoto@ntt.com> | 2015-06-22 19:17:25 +0900 |
|---|---|---|
| committer | Takeaki Matsumoto <takeaki.matsumoto@ntt.com> | 2015-07-24 09:20:56 +0900 |
| commit | b9eee5ee3209f78c9e4e86bce896876c3dbcf247 (patch) | |
| tree | d19bb94536b6e76e9eff5f75d37de3dddfe6c90b /glanceclient/shell.py | |
| parent | ec0f2dfd8500d230895e286462aaf69c43777038 (diff) | |
| download | python-glanceclient-b9eee5ee3209f78c9e4e86bce896876c3dbcf247.tar.gz | |
Add check Identity validate when get schemas
Glance client don't check Identity validate when get schemas.
So when you exec "glance image-create" with invalid credentials in
glance-api.conf, it returns "unrecognized arguments: --foo".
It is difficult to debug such message.
This change makes invalid credentials error clear.
Change-Id: Ib641333cd8d51f459df70306a1eeda250ada5ca1
Closes-Bug: 1467719
Diffstat (limited to 'glanceclient/shell.py')
| -rwxr-xr-x | glanceclient/shell.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/glanceclient/shell.py b/glanceclient/shell.py index 82195c8..492f35a 100755 --- a/glanceclient/shell.py +++ b/glanceclient/shell.py @@ -577,6 +577,9 @@ class OpenStackImagesShell(object): with open(schema_file_path, 'w') as f: f.write(json.dumps(schema.raw())) + except exc.Unauthorized: + raise exc.CommandError( + "Invalid OpenStack Identity credentials.") except Exception: # NOTE(esheffield) do nothing here, we'll get a message # later if the schema is missing |
