diff options
author | Andrey Pavlov <apavlov@mirantis.com> | 2015-11-13 14:36:07 +0300 |
---|---|---|
committer | Andrey Pavlov <apavlov@mirantis.com> | 2015-11-13 14:36:07 +0300 |
commit | 29a8eacf02c3e67fe70041748d8425350f495ce1 (patch) | |
tree | 9f30d3861664b6b6565604dcf6bac6364d48dca6 /saharaclient/api | |
parent | 3d36f9c65ec4019de03dd298b8021bfb35c814e9 (diff) | |
download | python-saharaclient-29a8eacf02c3e67fe70041748d8425350f495ce1.tar.gz |
Enabling DeprecationWarning if session is not provided
DeprecationWarning is ignored by default. Enable it so
that the deprecation message is displayed.
Change-Id: I40bfc82555d757eaba237b638bcd2753417f14f6
Closes-bug: #1515967
Diffstat (limited to 'saharaclient/api')
-rw-r--r-- | saharaclient/api/client.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/saharaclient/api/client.py b/saharaclient/api/client.py index 6b91aec..ba5230a 100644 --- a/saharaclient/api/client.py +++ b/saharaclient/api/client.py @@ -54,10 +54,12 @@ class Client(object): insecure=False, cacert=None, region_name=None, **kwargs): if not session: + warnings.simplefilter('once', category=DeprecationWarning) warnings.warn('Passing authentication parameters to saharaclient ' 'is deprecated. Please construct and pass an ' 'authenticated session object directly.', DeprecationWarning) + warnings.resetwarnings() if input_auth_token: auth = token_endpoint.Token(sahara_url, input_auth_token) |