From a4954dea4271f09f8f0d0f07e844dda45bd8b68d Mon Sep 17 00:00:00 2001 From: Pengju Jiao Date: Wed, 9 Aug 2017 19:53:01 +0800 Subject: [PATCH] Fix creating freezer client with keystone auth session Change-Id: I66e360ed36616a79bac24aca7ea364a0ed5aabe8 Closes-Bug: #1709608 (cherry picked from commit 85c5496e1d136aa725736409708d20bfc84135e8) --- freezerclient/v1/client.py | 2 +- freezerclient/v2/client.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/freezerclient/v1/client.py b/freezerclient/v1/client.py index add835d..79cce42 100644 --- a/freezerclient/v1/client.py +++ b/freezerclient/v1/client.py @@ -191,5 +191,5 @@ class Client(object): """Validate that the client objects gets created correctly. :return: bool """ - if self.opts.os_auth_url is None: + if not self._session and self.opts.os_auth_url is None: raise Exception('OS_AUTH_URL should be provided.') diff --git a/freezerclient/v2/client.py b/freezerclient/v2/client.py index 7820b04..3f1b025 100644 --- a/freezerclient/v2/client.py +++ b/freezerclient/v2/client.py @@ -193,5 +193,5 @@ class Client(object): """Validate that the client objects gets created correctly. :return: bool """ - if self.opts.os_auth_url is None: + if not self._session and self.opts.os_auth_url is None: raise Exception('OS_AUTH_URL should be provided.')