From b9eee5ee3209f78c9e4e86bce896876c3dbcf247 Mon Sep 17 00:00:00 2001 From: Takeaki Matsumoto Date: Mon, 22 Jun 2015 19:17:25 +0900 Subject: [PATCH] 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 --- glanceclient/shell.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glanceclient/shell.py b/glanceclient/shell.py index 82195c8c..492f35aa 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