summaryrefslogtreecommitdiff
path: root/nova
diff options
context:
space:
mode:
authorMichael Gundlach <michael.gundlach@rackspace.com>2010-10-11 11:43:58 -0400
committerMichael Gundlach <michael.gundlach@rackspace.com>2010-10-11 11:43:58 -0400
commitf9b2f70f22bdc8a9cf08ada5f7ec45eea6060866 (patch)
tree45039e685a112587b3eef831ce5ae783714d30b2 /nova
parent05e129b0d3e019efb5490266e05b9e157e0a50de (diff)
downloadnova-f9b2f70f22bdc8a9cf08ada5f7ec45eea6060866.tar.gz
Rename rsapi to osapi, and make the default subdomain for OpenStack API calls be 'api' instead of 'rs'.
Diffstat (limited to 'nova')
-rw-r--r--nova/api/__init__.py26
-rw-r--r--nova/tests/api/__init__.py4
-rw-r--r--nova/tests/api/openstack/fakes.py2
3 files changed, 16 insertions, 16 deletions
diff --git a/nova/api/__init__.py b/nova/api/__init__.py
index 627883018b..8ec7094d7d 100644
--- a/nova/api/__init__.py
+++ b/nova/api/__init__.py
@@ -31,12 +31,12 @@ from nova.api import openstack
from nova.api.ec2 import metadatarequesthandler
-flags.DEFINE_string('rsapi_subdomain', 'rs',
- 'subdomain running the RS API')
+flags.DEFINE_string('osapi_subdomain', 'api',
+ 'subdomain running the OpenStack API')
flags.DEFINE_string('ec2api_subdomain', 'ec2',
'subdomain running the EC2 API')
flags.DEFINE_string('FAKE_subdomain', None,
- 'set to rs or ec2 to fake the subdomain of the host for testing')
+ 'set to api or ec2 to fake the subdomain of the host for testing')
FLAGS = flags.FLAGS
@@ -44,21 +44,21 @@ class API(wsgi.Router):
"""Routes top-level requests to the appropriate controller."""
def __init__(self):
- rsdomain = {'sub_domain': [FLAGS.rsapi_subdomain]}
+ osapidomain = {'sub_domain': [FLAGS.osapi_subdomain]}
ec2domain = {'sub_domain': [FLAGS.ec2api_subdomain]}
- # If someone wants to pretend they're hitting the RS subdomain
- # on their local box, they can set FAKE_subdomain to 'rs', which
- # removes subdomain restrictions from the RS routes below.
- if FLAGS.FAKE_subdomain == 'rs':
- rsdomain = {}
+ # If someone wants to pretend they're hitting the OSAPI subdomain
+ # on their local box, they can set FAKE_subdomain to 'api', which
+ # removes subdomain restrictions from the OpenStack API routes below.
+ if FLAGS.FAKE_subdomain == 'api':
+ osapidomain = {}
elif FLAGS.FAKE_subdomain == 'ec2':
ec2domain = {}
mapper = routes.Mapper()
mapper.sub_domains = True
- mapper.connect("/", controller=self.rsapi_versions,
- conditions=rsdomain)
+ mapper.connect("/", controller=self.osapi_versions,
+ conditions=osapidomain)
mapper.connect("/v1.0/{path_info:.*}", controller=openstack.API(),
- conditions=rsdomain)
+ conditions=osapidomain)
mapper.connect("/", controller=self.ec2api_versions,
conditions=ec2domain)
@@ -81,7 +81,7 @@ class API(wsgi.Router):
super(API, self).__init__(mapper)
@webob.dec.wsgify
- def rsapi_versions(self, req):
+ def osapi_versions(self, req):
"""Respond to a request for all OpenStack API versions."""
response = {
"versions": [
diff --git a/nova/tests/api/__init__.py b/nova/tests/api/__init__.py
index 2c7f7fd3e4..f051e23908 100644
--- a/nova/tests/api/__init__.py
+++ b/nova/tests/api/__init__.py
@@ -46,7 +46,7 @@ class Test(unittest.TestCase):
def test_openstack(self):
self.stubs.Set(api.openstack, 'API', APIStub)
- result = self._request('/v1.0/cloud', 'rs')
+ result = self._request('/v1.0/cloud', 'api')
self.assertEqual(result.body, "/cloud")
def test_ec2(self):
@@ -61,7 +61,7 @@ class Test(unittest.TestCase):
self.assertNotEqual(result.body, "/cloud")
def test_query_api_versions(self):
- result = self._request('/', 'rs')
+ result = self._request('/', 'api')
self.assertTrue('CURRENT' in result.body)
def test_metadata(self):
diff --git a/nova/tests/api/openstack/fakes.py b/nova/tests/api/openstack/fakes.py
index 1119fa714a..34bc1f2a9f 100644
--- a/nova/tests/api/openstack/fakes.py
+++ b/nova/tests/api/openstack/fakes.py
@@ -105,7 +105,7 @@ def stub_out_networking(stubs):
def get_my_ip():
return '127.0.0.1'
stubs.Set(nova.utils, 'get_my_ip', get_my_ip)
- FLAGS.FAKE_subdomain = 'rs'
+ FLAGS.FAKE_subdomain = 'api'
def stub_out_glance(stubs):