From ae0515c3a078ce27ccca1ef5a98092208c030f2f Mon Sep 17 00:00:00 2001 From: ayoung Date: Sat, 5 May 2012 14:08:18 -0400 Subject: Admin Auth URI prefix Allows the prepending of a prefix to the URI used for admin tasks. This allows URIs like https://hostname/keystone/main/v2.0 PEP8 fix Added To Unit test to ensure auth_prefix is checked Bug: 994860 Change-Id: I851e059e8b17c1bc02ab93d8b09a3fb47b9d3fee --- keystone/middleware/auth_token.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'keystone/middleware') diff --git a/keystone/middleware/auth_token.py b/keystone/middleware/auth_token.py index b383aaf9..d504e20c 100644 --- a/keystone/middleware/auth_token.py +++ b/keystone/middleware/auth_token.py @@ -139,6 +139,7 @@ class AuthProtocol(object): default_auth_uri = '%s://%s:%s' % (self.auth_protocol, self.auth_host, self.auth_port) + self.auth_admin_prefix = conf.get('auth_admin_prefix', '') self.auth_uri = conf.get('auth_uri', default_auth_uri) # SSL @@ -296,8 +297,9 @@ class AuthProtocol(object): if body: kwargs['body'] = jsonutils.dumps(body) + full_path = self.auth_admin_prefix + path try: - conn.request(method, path, **kwargs) + conn.request(method, full_path, **kwargs) response = conn.getresponse() body = response.read() except Exception, e: -- cgit