diff options
author | Ruan HE <ruan.he@orange.com> | 2016-05-23 18:05:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-05-23 18:05:59 +0000 |
commit | a33bdcb627102a01244630a54cb4b5066b385a6a (patch) | |
tree | 263cdac4550335027fe80f32fa8abbe333ae075f | |
parent | a144edd93b3a940ad746fd0d8693ba04fdb99474 (diff) | |
parent | 8f9cc03d2104287fa8d307df421b35130727d252 (diff) |
Merge "Fix configuration names."
-rw-r--r-- | keystonemiddleware-moon/keystonemiddleware/moon_agent.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/keystonemiddleware-moon/keystonemiddleware/moon_agent.py b/keystonemiddleware-moon/keystonemiddleware/moon_agent.py index b21d9dbe..7e196ef6 100644 --- a/keystonemiddleware-moon/keystonemiddleware/moon_agent.py +++ b/keystonemiddleware-moon/keystonemiddleware/moon_agent.py @@ -21,8 +21,14 @@ _OPTS = [ cfg.StrOpt('auth_version', default=None, help='API version of the admin Identity API endpoint.'), - cfg.StrOpt('keystonemiddleware_agent_logfile', # TODO: update in the paste.ini - default="/tmp/moon_keystonemiddleware_agent.log", + cfg.StrOpt('authz_login', + default="admin", + help='Name of the administrator who will connect to the Keystone Moon backends.'), + cfg.StrOpt('authz_password', + default="nomoresecrete", + help='Password of the administrator who will connect to the Keystone Moon backends.'), + cfg.StrOpt('logfile', + default="/tmp/authz.log", help='File where logs goes.'), ] @@ -68,14 +74,6 @@ class MoonAgentKeystoneMiddleware(object): "password": "nomoresecrete" } } - }, - "scope": { - "project": { - "domain": { - "id": "Default" - }, - "name": "demo" - } } } } @@ -84,7 +82,7 @@ class MoonAgentKeystoneMiddleware(object): self.conf = conf self._LOG = logging.getLogger(conf.get('log_name', __name__)) # FIXME: events are duplicated in log file - moon_agent_fh = logging.FileHandler(CONF.moon_keystonemiddleware_agent["keystonemiddleware_agent_logfile"]) + moon_agent_fh = logging.FileHandler(CONF.moon_keystonemiddleware_agent["logfile"]) self._LOG.setLevel(logging.DEBUG) self._LOG.addHandler(moon_agent_fh) self._LOG.info(_LI('Starting Moon KeystoneMiddleware Agent')) @@ -118,6 +116,8 @@ class MoonAgentKeystoneMiddleware(object): self.local_registered_mgr_dict["authz_mgr"] = AuthzMgr(self._conf) def __set_token(self): + self.post_data["auth"]["identity"]["password"]["user"]["name"] = self.conf.get('authz_login', "admin") + self.post_data["auth"]["identity"]["password"]["user"]["password"] = self.conf.get('authz_password', "nomoresecrete") data = self.get_url("/v3/auth/tokens", post_data=self.post_data) if "token" not in data: raise Exception("Authentication problem ({})".format(data)) |