Update the init of the collector to take in a conf
In the Ocata release, there is a new conf variable that is passed into the collector. This is generally used by the libvirt collector at the moment. It is not needed by the PowerVM collector, but the __init__ signature needs to be updated to take it in. This change brings the PowerVM collector in line with the base requirements from the core ceilometer project. Change-Id: Ib5620f6830949f50939d07ba07be900a5451df56
This commit is contained in:
parent
95c7897367
commit
1c69b80258
|
@ -40,8 +40,8 @@ class PowerVMInspector(virt_inspector.Inspector):
|
||||||
Utilizes the pypowervm library to gather the instance metrics.
|
Utilizes the pypowervm library to gather the instance metrics.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, conf):
|
||||||
super(PowerVMInspector, self).__init__()
|
super(PowerVMInspector, self).__init__(conf)
|
||||||
|
|
||||||
# Build the adapter. May need to attempt the connection multiple times
|
# Build the adapter. May need to attempt the connection multiple times
|
||||||
# in case the REST server is starting.
|
# in case the REST server is starting.
|
||||||
|
|
|
@ -42,7 +42,7 @@ class TestPowerVMInspectorInit(base.BaseTestCase):
|
||||||
mock_get_host_uuid.return_value = 'host_uuid'
|
mock_get_host_uuid.return_value = 'host_uuid'
|
||||||
|
|
||||||
# Invoke
|
# Invoke
|
||||||
inspector = p_inspect.PowerVMInspector()
|
inspector = p_inspect.PowerVMInspector(None)
|
||||||
|
|
||||||
# Validate
|
# Validate
|
||||||
mock_session.assert_called_once_with(conn_tries=300)
|
mock_session.assert_called_once_with(conn_tries=300)
|
||||||
|
@ -76,7 +76,7 @@ class TestPowerVMInspector(base.BaseTestCase):
|
||||||
with mock.patch('ceilometer_powervm.compute.virt.powervm.inspector.'
|
with mock.patch('ceilometer_powervm.compute.virt.powervm.inspector.'
|
||||||
'PowerVMInspector._get_host_uuid'):
|
'PowerVMInspector._get_host_uuid'):
|
||||||
# Create the inspector
|
# Create the inspector
|
||||||
self.inspector = p_inspect.PowerVMInspector()
|
self.inspector = p_inspect.PowerVMInspector(None)
|
||||||
self.inspector.vm_metrics = self.mock_metrics
|
self.inspector.vm_metrics = self.mock_metrics
|
||||||
|
|
||||||
def test_inspect_cpus(self):
|
def test_inspect_cpus(self):
|
||||||
|
|
Loading…
Reference in New Issue