diff options
-rw-r--r-- | Authors | 1 | ||||
-rw-r--r-- | nova/api/ec2/__init__.py | 29 |
2 files changed, 22 insertions, 8 deletions
@@ -170,3 +170,4 @@ Yuriy Taraday <yorik.sar@gmail.com> Zed Shaw <zedshaw@zedshaw.com> Zhixue Wu <Zhixue.Wu@citrix.com> Zhongyue Luo <lzyeval@gmail.com> +Ziad Sawalha <github@highbridgellc.com> diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py index dfcddbc4e..3ee89c9c2 100644 --- a/nova/api/ec2/__init__.py +++ b/nova/api/ec2/__init__.py @@ -185,14 +185,27 @@ class EC2Token(wsgi.Middleware): # Not part of authentication args auth_params.pop('Signature') - # Authenticate the request. - creds = {'ec2Credentials': {'access': access, - 'signature': signature, - 'host': req.host, - 'verb': req.method, - 'path': req.path, - 'params': auth_params, - }} + if "ec2" in FLAGS.keystone_ec2_url: + LOG.warning("Configuration setting for keystone_ec2_url needs " + "to be updated to /tokens only. The /ec2 prefix is " + "being deprecated") + # Authenticate the request. + creds = {'ec2Credentials': {'access': access, + 'signature': signature, + 'host': req.host, + 'verb': req.method, + 'path': req.path, + 'params': auth_params, + }} + else: + # Authenticate the request. + creds = {'auth': {'OS-KSEC2:ec2Credentials': {'access': access, + 'signature': signature, + 'host': req.host, + 'verb': req.method, + 'path': req.path, + 'params': auth_params, + }}} creds_json = utils.dumps(creds) headers = {'Content-Type': 'application/json'} |