diff options
author | Daniel Wakefield <daniel.wakefield@hp.com> | 2014-10-20 18:00:01 +0100 |
---|---|---|
committer | Alistair Coles <alistair.coles@hp.com> | 2014-10-21 08:23:26 +0000 |
commit | 025da14326d29051119fff50424748e41bf4be42 (patch) | |
tree | 8de2977739d6009ba1597396ae0c22fd8ab661e2 /swiftclient/client.py | |
parent | 43c1141baa6c5a5987fd4ab71d1c2299898ea251 (diff) | |
download | python-swiftclient-025da14326d29051119fff50424748e41bf4be42.tar.gz |
Replaces Stacktraces with useful error messages.
Changed the message shown when a user doesn't enter project/tenant
id/name to be more informative.
When attempting to stat a container without supplying project/tenant
name or id, an empty response was being returned instead of an error
being raised.
Changed the error raised in swiftclient.client when no tenant or project
is specified to be more specific.
Add tests for basic regression checking.
Closes-Bug: #1372589
Change-Id: I4eb6964d9f1702db119cc0294edc02841b1ecd5f
Diffstat (limited to 'swiftclient/client.py')
-rw-r--r-- | swiftclient/client.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index def40bf..8cbedc7 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -396,7 +396,9 @@ def get_auth(auth_url, user, key, **kwargs): if not (os_options.get('tenant_name') or os_options.get('tenant_id') or os_options.get('project_name') or os_options.get('project_id')): - raise ClientException('No tenant specified') + if auth_version in AUTH_VERSIONS_V2: + raise ClientException('No tenant specified') + raise ClientException('No project name or project id specified.') cacert = kwargs.get('cacert', None) storage_url, token = get_auth_keystone(auth_url, user, |