Adds support for multiple API ports, one for each API type (OS, EC2).

This commit is contained in:
Eric Day
2010-11-02 19:44:33 +00:00
committed by Tarmac
2 changed files with 8 additions and 7 deletions

View File

@@ -37,13 +37,18 @@ from nova import utils
from nova import server from nova import server
FLAGS = flags.FLAGS FLAGS = flags.FLAGS
flags.DEFINE_integer('api_port', 8773, 'API port') flags.DEFINE_integer('osapi_port', 8774, 'OpenStack API port')
flags.DEFINE_integer('ec2api_port', 8773, 'EC2 API port')
def main(_args): def main(_args):
from nova import api from nova import api
from nova import wsgi from nova import wsgi
wsgi.run_server(api.API(), FLAGS.api_port) server = wsgi.Server()
server.start(api.API('os'), FLAGS.osapi_port)
server.start(api.API('ec2'), FLAGS.ec2api_port)
server.wait()
if __name__ == '__main__': if __name__ == '__main__':
utils.default_flagfile() utils.default_flagfile()

View File

@@ -34,10 +34,6 @@ from nova.api.ec2 import apirequest
from nova.auth import manager from nova.auth import manager
FLAGS = flags.FLAGS
FLAGS.FAKE_subdomain = 'ec2'
class FakeHttplibSocket(object): class FakeHttplibSocket(object):
"""a fake socket implementation for httplib.HTTPResponse, trivial""" """a fake socket implementation for httplib.HTTPResponse, trivial"""
def __init__(self, response_string): def __init__(self, response_string):
@@ -109,7 +105,7 @@ class ApiEc2TestCase(test.TrialTestCase):
self.host = '127.0.0.1' self.host = '127.0.0.1'
self.app = api.API() self.app = api.API('ec2')
def expect_http(self, host=None, is_secure=False): def expect_http(self, host=None, is_secure=False):
"""Returns a new EC2 connection""" """Returns a new EC2 connection"""