Merge "swift: configure RPC service correctly"
This commit is contained in:
commit
5c82b1ee95
@ -27,6 +27,7 @@ from ceilometer.openstack.common import cfg
|
||||
from ceilometer.openstack.common import context
|
||||
from ceilometer.openstack.common import timeutils
|
||||
from ceilometer import pipeline
|
||||
from ceilometer import service
|
||||
|
||||
from swift.common.utils import split_path
|
||||
|
||||
@ -51,7 +52,7 @@ class CeilometerMiddleware(object):
|
||||
|
||||
def __init__(self, app, conf):
|
||||
self.app = app
|
||||
cfg.CONF([], project='ceilometer')
|
||||
service.prepare_service()
|
||||
publisher_manager = dispatch.NameDispatchExtensionManager(
|
||||
namespace=pipeline.PUBLISHER_NAMESPACE,
|
||||
check_func=lambda x: True,
|
||||
|
@ -23,6 +23,7 @@ from webob import Request
|
||||
from ceilometer.tests import base
|
||||
from ceilometer.objectstore import swift_middleware
|
||||
from ceilometer import pipeline
|
||||
from ceilometer.openstack.common import cfg
|
||||
|
||||
|
||||
class FakeApp(object):
|
||||
@ -60,6 +61,10 @@ class TestSwiftMiddleware(base.TestCase):
|
||||
def start_response(*args):
|
||||
pass
|
||||
|
||||
def test_rpc_setup(self):
|
||||
app = swift_middleware.CeilometerMiddleware(FakeApp(), {})
|
||||
self.assertEqual(cfg.CONF.control_exchange, 'ceilometer')
|
||||
|
||||
def test_get(self):
|
||||
app = swift_middleware.CeilometerMiddleware(FakeApp(), {})
|
||||
req = Request.blank('/1.0/account/container/obj',
|
||||
|
Loading…
x
Reference in New Issue
Block a user