Move service broker api to the top level

Create separate murano-cfapi-paste.ini for service broker,
Change service broker start command to:
`murano-cfapi --config-file etc/murano/murano-cfapi.conf`

And move service broker api to the top level.

Change-Id: Id56786f31c16da11019a2064cc4285bdd266f538
partial-implement: bp separate-service-broker-from-murano
This commit is contained in:
zhurong 2016-04-13 14:08:23 +00:00
parent deb487d8c0
commit 176379f601
7 changed files with 38 additions and 12 deletions

View File

@ -0,0 +1,30 @@
[pipeline:cloudfoundry]
pipeline = cors request_id ssl ext_context authtoken context cloudfoundryapi
[filter:context]
paste.filter_factory = murano.api.middleware.context:ContextMiddleware.factory
#For more information see Auth-Token Middleware with Username and Password
#http://docs.openstack.org/developer/keystone/configuringservices.html
[filter:authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
[app:cloudfoundryapi]
paste.app_factory = murano.cfapi.router:API.factory
[filter:faultwrap]
paste.filter_factory = murano.api.middleware.fault:FaultWrapper.factory
# Middleware to set x-openstack-request-id in http response header
[filter:request_id]
paste.filter_factory = oslo_middleware.request_id:RequestId.factory
[filter:ssl]
paste.filter_factory = murano.api.middleware.ssl:SSLMiddleware.factory
[filter:ext_context]
paste.filter_factory = murano.api.middleware.ext_context:ExternalContextMiddleware.factory
[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = murano

View File

@ -24,7 +24,7 @@ paste.app_factory = murano.api.versions:create_resource
paste.app_factory = murano.api.v1.router:API.factory
[app:cloudfoundryapi]
paste.app_factory = murano.api.v1.cloudfoundry.router:API.factory
paste.app_factory = murano.cfapi.router:API.factory
[filter:versionnegotiation]
paste.filter_factory = murano.api.middleware.version_negotiation:VersionNegotiationFilter.factory

View File

@ -13,7 +13,7 @@
# under the License.
import routes
from murano.api.v1.cloudfoundry import cfapi
from murano.cfapi import cfapi
from murano.common import wsgi

View File

@ -37,7 +37,6 @@ from murano.api.v1 import request_statistics
from murano.common import app_loader
from murano.common import cf_config as config
from murano.common import policy
from murano.common import server
from murano.common import wsgi
CONF = cfg.CONF
@ -65,9 +64,6 @@ def main():
launcher.launch_service(wsgi.Service(cfapp, cfport, cfhost))
launcher.launch_service(server.ApiService())
launcher.launch_service(server.NotificationService())
launcher.wait()
except RuntimeError as e:
sys.stderr.write("ERROR: %s\n" % e)

View File

@ -17,7 +17,7 @@ import mock
from oslo_serialization import base64
from webob import response
from murano.api.v1.cloudfoundry import cfapi as api
from murano.cfapi import cfapi as api
from murano.tests.unit import base
@ -33,7 +33,7 @@ class TestController(base.MuranoTestCase):
'X-Project-Id': 'bar-baz'}
@mock.patch('murano.common.policy.check_is_admin')
@mock.patch('murano.api.v1.cloudfoundry.cfapi._get_muranoclient')
@mock.patch('murano.cfapi.cfapi._get_muranoclient')
def test_list(self, mock_client, mock_policy):
pkg0 = mock.MagicMock()
@ -60,7 +60,7 @@ class TestController(base.MuranoTestCase):
self.assertEqual(answer, resp)
@mock.patch('murano.common.policy.check_is_admin')
@mock.patch('murano.api.v1.cloudfoundry.cfapi._get_muranoclient')
@mock.patch('murano.cfapi.cfapi._get_muranoclient')
@mock.patch('murano.db.services.cf_connections.set_instance_for_service')
@mock.patch('murano.db.services.cf_connections.get_environment_for_space')
@mock.patch('murano.db.services.cf_connections.get_tenant_for_org')
@ -85,7 +85,7 @@ class TestController(base.MuranoTestCase):
@mock.patch('murano.common.policy.check_is_admin')
@mock.patch('murano.db.catalog.api.package_get')
@mock.patch('murano.api.v1.cloudfoundry.cfapi._get_muranoclient')
@mock.patch('murano.cfapi.cfapi._get_muranoclient')
@mock.patch('murano.db.services.cf_connections.set_instance_for_service')
@mock.patch('murano.db.services.cf_connections.set_environment_for_space')
@mock.patch('murano.db.services.cf_connections.set_tenant_for_org')
@ -112,7 +112,7 @@ class TestController(base.MuranoTestCase):
self.assertIsInstance(resp, response.Response)
@mock.patch('murano.api.v1.cloudfoundry.cfapi._get_muranoclient')
@mock.patch('murano.cfapi.cfapi._get_muranoclient')
@mock.patch('murano.db.services.cf_connections.get_service_for_instance')
def test_deprovision(self, mock_get_si, mock_client):
service = mock.MagicMock()
@ -125,7 +125,7 @@ class TestController(base.MuranoTestCase):
self.assertIsInstance(resp, response.Response)
@mock.patch('murano.api.v1.cloudfoundry.cfapi._get_muranoclient')
@mock.patch('murano.cfapi.cfapi._get_muranoclient')
@mock.patch('murano.db.services.cf_connections.get_service_for_instance')
def test_bind(self, mock_get_si, mock_client):
service = mock.MagicMock()