aboutsummaryrefslogtreecommitdiffstats
path: root/python_moonutilities/python_moonutilities/auth.py
diff options
context:
space:
mode:
authorThomas Duval <thomas.duval@orange.com>2017-12-28 11:42:07 +0100
committerThomas Duval <thomas.duval@orange.com>2017-12-28 14:28:00 +0100
commit5bdbd6fc5b3f1aac00e20958c2d1307dd36a9f44 (patch)
treea6c28f48388efc68d42ad95dd8acf6bb23089798 /python_moonutilities/python_moonutilities/auth.py
parent9cf58823b4fa426816acfef81a562054d26afde8 (diff)
Clean the code
Change-Id: If508aa1ac6fd439dc6da916868b60adfce3dd72d
Diffstat (limited to 'python_moonutilities/python_moonutilities/auth.py')
-rw-r--r--python_moonutilities/python_moonutilities/auth.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python_moonutilities/python_moonutilities/auth.py b/python_moonutilities/python_moonutilities/auth.py
index 7656f4e7..5f921d0b 100644
--- a/python_moonutilities/python_moonutilities/auth.py
+++ b/python_moonutilities/python_moonutilities/auth.py
@@ -12,7 +12,7 @@ from oslo_log import log as logging
from python_moonutilities import exceptions, configuration
-LOG = logging.getLogger(__name__)
+logger = logging.getLogger(__name__)
KEYSTONE_CONFIG = configuration.get_configuration("openstack/keystone")["openstack/keystone"]
TOKENS = {}
@@ -52,13 +52,13 @@ def check_token(token, url=None):
TOKENS[token]["expires_at"] = time.strptime(token_time[0], "%Y-%m-%dT%H:%M:%S")
TOKENS[token]["user"] = req.json().get("token").get("user").get("id")
return TOKENS[token]["user"]
- LOG.error("{} - {}".format(req.status_code, req.text))
+ logger.error("{} - {}".format(req.status_code, req.text))
raise exceptions.KeystoneError
elif KEYSTONE_CONFIG['check_token'].lower() == "strict":
req = requests.head("{}/auth/tokens".format(url), headers=headers, verify=_verify)
if req.status_code in (200, 201):
return token
- LOG.error("{} - {}".format(req.status_code, req.text))
+ logger.error("{} - {}".format(req.status_code, req.text))
raise exceptions.KeystoneError
raise exceptions.KeystoneError