diff --git a/ceilometer/compute/virt/vmware/inspector.py b/ceilometer/compute/virt/vmware/inspector.py index 46f83d4e9..32c66fb83 100644 --- a/ceilometer/compute/virt/vmware/inspector.py +++ b/ceilometer/compute/virt/vmware/inspector.py @@ -17,7 +17,6 @@ from oslo.config import cfg from oslo.vmware import api -from oslo.vmware import vim from ceilometer.compute.virt import inspector as virt_inspector from ceilometer.compute.virt.vmware import vsphere_operations @@ -43,7 +42,12 @@ OPTS = [ cfg.FloatOpt('task_poll_interval', default=0.5, help='Sleep time in seconds for polling an ongoing async ' - 'task') + 'task'), + cfg.StrOpt('wsdl_location', + help='Optional vim service WSDL location ' + 'e.g http:///vimService.wsdl. ' + 'Optional over-ride to default location for bug ' + 'work-arounds'), ] cfg.CONF.register_group(opt_group) @@ -60,15 +64,13 @@ VC_DISK_WRITE_REQUESTS_RATE_CNTR = "disk:numberWriteAveraged:average" def get_api_session(): - hostIp = cfg.CONF.vmware.host_ip - wsdl_loc = vim.Vim._get_wsdl_loc("https", hostIp) api_session = api.VMwareAPISession( - hostIp, + cfg.CONF.vmware.host_ip, cfg.CONF.vmware.host_username, cfg.CONF.vmware.host_password, cfg.CONF.vmware.api_retry_count, cfg.CONF.vmware.task_poll_interval, - wsdl_loc=wsdl_loc) + wsdl_loc=cfg.CONF.vmware.wsdl_location) return api_session diff --git a/ceilometer/tests/compute/virt/vmware/test_inspector.py b/ceilometer/tests/compute/virt/vmware/test_inspector.py index 56b1f3518..d5ee4c85e 100644 --- a/ceilometer/tests/compute/virt/vmware/test_inspector.py +++ b/ceilometer/tests/compute/virt/vmware/test_inspector.py @@ -31,7 +31,6 @@ class TestVsphereInspection(test.BaseTestCase): api_session = api.VMwareAPISession("test_server", "test_user", "test_password", 0, None, create_session=False) - api_session._vim = mock.MagicMock() vsphere_inspector.get_api_session = mock.Mock( return_value=api_session) self._inspector = vsphere_inspector.VsphereInspector()