Merge "Fix the wrong usage of new style class in metering"

This commit is contained in:
Zuul 2017-10-31 21:20:21 +00:00 committed by Gerrit Code Review
commit f39911bc6c
2 changed files with 5 additions and 1 deletions

View File

@ -48,7 +48,7 @@ class MeteringPluginRpc(object):
# aesthetics. Because of multiple inheritances in MeteringAgent,
# it's actually necessary to initialize parent classes of
# manager.Manager correctly.
super(MeteringPluginRpc, self).__init__()
super(MeteringPluginRpc, self).__init__(host)
target = oslo_messaging.Target(topic=topics.METERING_PLUGIN,
version='1.0')
self.client = n_rpc.get_client(target)

View File

@ -224,6 +224,10 @@ class TestMeteringOperations(base.BaseTestCase):
'last_update': 2})
self._test_add_metering_info(expected_info, 2)
def test_metering_agent_host_value(self):
expected_host = 'my agent'
self.assertEqual(expected_host, self.agent.host)
class TestMeteringDriver(base.BaseTestCase):
def setUp(self):