diff -r 4be1f488dda8 -r db0cec748ec0 components/openstack/keystone/patches/02-launchpad-1178740.patch --- a/components/openstack/keystone/patches/02-launchpad-1178740.patch Tue Apr 07 15:49:29 2015 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -This upstream patch addresses Launchpad bug 1178740. Although it's been -addressed in Icehouse 2014.1, the patch below is still not yet released -for Havana. - -commit 4f800bbe7f5ba07895a4cb32c14007e2f1818bd7 -Author: Lei Zhang -Date: Tue Oct 8 17:40:37 2013 +0800 - - remove the nova dependency in the ec2_token middleware - - Change-Id: I34812522b55e38d3ea030638bbae75d65f507c90 - Closes-Bug: #1178740 - -diff --git a/keystone/middleware/ec2_token.py b/keystone/middleware/ec2_token.py -index 0cd5841..4e58eac 100644 ---- a/keystone/middleware/ec2_token.py -+++ b/keystone/middleware/ec2_token.py -@@ -25,18 +25,22 @@ Starting point for routing EC2 requests. - import urlparse - - from eventlet.green import httplib -+from oslo.config import cfg - import webob.dec - import webob.exc - --from nova import flags --from nova import utils --from nova import wsgi -+from keystone.common import config -+from keystone.common import wsgi -+from keystone.openstack.common import jsonutils - -+keystone_ec2_opts = [ -+ cfg.StrOpt('keystone_ec2_url', -+ default='http://localhost:5000/v2.0/ec2tokens', -+ help='URL to get token from ec2 request.'), -+] - --FLAGS = flags.FLAGS --flags.DEFINE_string('keystone_ec2_url', -- 'http://localhost:5000/v2.0/ec2tokens', -- 'URL to get token from ec2 request.') -+CONF = config.CONF -+CONF.register_opts(keystone_ec2_opts) - - - class EC2Token(wsgi.Middleware): -@@ -67,13 +71,13 @@ class EC2Token(wsgi.Middleware): - 'params': auth_params, - } - } -- creds_json = utils.dumps(creds) -+ creds_json = jsonutils.dumps(creds) - headers = {'Content-Type': 'application/json'} - - # Disable 'has no x member' pylint error - # for httplib and urlparse - # pylint: disable-msg=E1101 -- o = urlparse.urlparse(FLAGS.keystone_ec2_url) -+ o = urlparse.urlparse(CONF.keystone_ec2_url) - if o.scheme == 'http': - conn = httplib.HTTPConnection(o.netloc) - else: -@@ -86,7 +90,7 @@ class EC2Token(wsgi.Middleware): - # having keystone return token, tenant, - # user, and roles from this call. - -- result = utils.loads(response) -+ result = jsonutils.loads(response) - try: - token_id = result['access']['token']['id'] - except (AttributeError, KeyError):