summaryrefslogtreecommitdiffstats
path: root/keystonemiddleware-moon/keystonemiddleware/moon_mgrs
diff options
context:
space:
mode:
authorasteroide <thomas.duval@orange.com>2016-05-24 13:47:04 +0200
committerasteroide <thomas.duval@orange.com>2016-05-24 13:47:04 +0200
commit9ab03276ef3653bbe30b3f534b12c466d1e2cc37 (patch)
tree2456c9371f63255cfa1d34dff0dc535fda21514e /keystonemiddleware-moon/keystonemiddleware/moon_mgrs
parenta33bdcb627102a01244630a54cb4b5066b385a6a (diff)
Fix bugs in log configurations.
Change-Id: I9c47abac0bb116a03cf97a362d2627a0528e60b5
Diffstat (limited to 'keystonemiddleware-moon/keystonemiddleware/moon_mgrs')
-rw-r--r--keystonemiddleware-moon/keystonemiddleware/moon_mgrs/authz_mgr/authz_mgr.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/keystonemiddleware-moon/keystonemiddleware/moon_mgrs/authz_mgr/authz_mgr.py b/keystonemiddleware-moon/keystonemiddleware/moon_mgrs/authz_mgr/authz_mgr.py
index 0d81a790..9a0a4009 100644
--- a/keystonemiddleware-moon/keystonemiddleware/moon_mgrs/authz_mgr/authz_mgr.py
+++ b/keystonemiddleware-moon/keystonemiddleware/moon_mgrs/authz_mgr/authz_mgr.py
@@ -10,13 +10,13 @@ from oslo_config import cfg
_OPTS = [
- cfg.StrOpt('authz_mgr_login',
+ cfg.StrOpt('authz_login',
default="admin",
help='Name of the administrator who will connect to the Keystone Moon backends.'),
- cfg.StrOpt('authz_mgr_password',
+ cfg.StrOpt('authz_password',
default="nomoresecrete",
help='Password of the administrator who will connect to the Keystone Moon backends.'),
- cfg.StrOpt('authz_mgr_logfile',
+ cfg.StrOpt('logfile',
default="/tmp/moon_authz_mgr.log", # TODO: update in paste.init
help='File where logs goes.'),
]
@@ -34,11 +34,11 @@ class ServiceError(Exception):
class AuthzMgr(object):
def __init__(self, conf):
+ self.conf = conf
self._LOG = logging.getLogger(conf.get('log_name', __name__))
- authz_mgr_fh = logging.FileHandler(CONF.moon_authz_mgr["authz_mgr_logfile"])
+ authz_mgr_fh = logging.FileHandler(self.conf.get('logfile', "/tmp/keystonemiddleware.log"))
self._LOG.setLevel(logging.DEBUG)
self._LOG.addHandler(authz_mgr_fh)
- self._conf = conf
self.response_content = ""
def _deny_request(self, code):
@@ -67,7 +67,7 @@ class AuthzMgr(object):
self._LOG.debug('X-Auth-Token={}'.format(auth_token))
try:
_url = '{}/moon/authz/{}/{}/{}/{}'.format(
- self._conf["_request_uri"],
+ self.conf["_request_uri"],
agent_data['tenant_id'],
agent_data['user_id'],
agent_data['resource_id'],
@@ -75,7 +75,7 @@ class AuthzMgr(object):
self._LOG.info(_url)
response = requests.get(_url,
headers=headers,
- verify=self._conf["_verify"])
+ verify=self.conf["_verify"])
except requests.exceptions.RequestException as e:
self._LOG.error(_LI('HTTP connection exception: %s'), e)
resp = self._deny_request('InvalidURI')