summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2010-12-17 00:43:18 +0000
committerVishvananda Ishaya <vishvananda@gmail.com>2010-12-17 00:43:18 +0000
commit86f71493fa5a02762bc7c56308c85b9182913efb (patch)
treee3fb7c7f35a584490e59c876440e08e6ba348a0d /nova/api
parent26ebccc8d92aba23efa1663fe9949c141a4cc671 (diff)
downloadnova-86f71493fa5a02762bc7c56308c85b9182913efb.tar.gz
nova-86f71493fa5a02762bc7c56308c85b9182913efb.tar.xz
nova-86f71493fa5a02762bc7c56308c85b9182913efb.zip
move some flags around
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/__init__.py2
-rw-r--r--nova/api/ec2/cloud.py16
2 files changed, 11 insertions, 7 deletions
diff --git a/nova/api/__init__.py b/nova/api/__init__.py
index 95fc6b145..803470570 100644
--- a/nova/api/__init__.py
+++ b/nova/api/__init__.py
@@ -29,7 +29,6 @@ import routes
import webob.dec
from nova import flags
-from nova import utils
from nova import wsgi
from nova.api import ec2
from nova.api import openstack
@@ -40,6 +39,7 @@ flags.DEFINE_string('osapi_subdomain', 'api',
'subdomain running the OpenStack API')
flags.DEFINE_string('ec2api_subdomain', 'ec2',
'subdomain running the EC2 API')
+
FLAGS = flags.FLAGS
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index ebb13aedc..684e29ee1 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -196,15 +196,19 @@ class CloudController(object):
if FLAGS.region_list:
regions = []
for region in FLAGS.region_list:
- name, _sep, url = region.partition('=')
+ name, _sep, host = region.partition('=')
+ endpoint = '%s://%s:%s%s' % (FLAGS.ec2_prefix,
+ host,
+ FLAGS.cc_port,
+ FLAGS.ec2_suffix)
regions.append({'regionName': name,
- 'regionEndpoint': url})
+ 'regionEndpoint': endpoint})
else:
regions = [{'regionName': 'nova',
- 'regionEndpoint': FLAGS.ec2_url}]
- if region_name:
- regions = [r for r in regions if r['regionName'] in region_name]
- return {'regionInfo': regions}
+ 'regionEndpoint': '%s://%s:%s%s' % (FLAGS.ec2_prefix,
+ FLAGS.cc_host,
+ FLAGS.cc_port,
+ FLAGS.ec2_suffix)}]
def describe_snapshots(self,
context,