Virt: remove unused 'host' parameter from get_host_uptime

Commit af4dc62e49 suggested that
we drop the unused parameter.

Change-Id: Ib6e74ec27cd164df25cb9c46627f3cdcc040a022
This commit is contained in:
Gary Kotton
2015-01-21 04:35:53 -08:00
parent 9595d09e05
commit a05846dc62
10 changed files with 11 additions and 13 deletions

View File

@@ -4066,7 +4066,7 @@ class ComputeManager(manager.Manager):
@wrap_exception()
def get_host_uptime(self, context):
"""Returns the result of calling "uptime" on the target host."""
return self.driver.get_host_uptime(self.host)
return self.driver.get_host_uptime()
@object_compat
@wrap_exception()

View File

@@ -664,7 +664,7 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
@catch_notimplementederror
def test_get_host_uptime(self):
self.connection.get_host_uptime('a useless argument?')
self.connection.get_host_uptime()
@catch_notimplementederror
def test_host_power_action_reboot(self):

View File

@@ -2470,7 +2470,7 @@ class VMwareAPIVMTestCase(test.NoDBTestCase):
def test_get_host_uptime(self):
self.assertRaises(NotImplementedError,
self.conn.get_host_uptime, 'host')
self.conn.get_host_uptime)
def _test_finish_migration(self, power_on, resize_instance=False):
"""Tests the finish_migration method on VC Driver."""

View File

@@ -2144,7 +2144,7 @@ class XenAPIHostTestCase(stubs.XenAPITestBase):
self.assertEqual(service.disabled, True)
def test_get_host_uptime(self):
result = self.conn.get_host_uptime('host')
result = self.conn.get_host_uptime()
self.assertEqual(result, 'fake uptime')
def test_supported_instances_is_included_in_host_state(self):

View File

@@ -1026,7 +1026,7 @@ class ComputeDriver(object):
# TODO(Vek): Need to pass context in for access to auth_token
raise NotImplementedError()
def get_host_uptime(self, host):
def get_host_uptime(self):
"""Returns the result of calling "uptime" on the target host."""
# TODO(Vek): Need to pass context in for access to auth_token
raise NotImplementedError()

View File

@@ -233,7 +233,7 @@ class HyperVDriver(driver.ComputeDriver):
def get_host_ip_addr(self):
return self._hostops.get_host_ip_addr()
def get_host_uptime(self, host):
def get_host_uptime(self):
return self._hostops.get_host_uptime()
def get_rdp_console(self, context, instance):

View File

@@ -5637,10 +5637,8 @@ class LibvirtDriver(driver.ComputeDriver):
stats["frequency"] = self._conn.getInfo()[3]
return stats
def get_host_uptime(self, host):
def get_host_uptime(self):
"""Returns the result of calling "uptime"."""
# NOTE(dprince): host seems to be ignored for this call and in
# other compute drivers as well. Perhaps we should remove it?
out, err = utils.execute('env', 'LANG=C', 'uptime')
return out

View File

@@ -596,7 +596,7 @@ class VMwareVCDriver(driver.ComputeDriver):
"""
raise NotImplementedError()
def get_host_uptime(self, host):
def get_host_uptime(self):
"""Host uptime operation not supported by VC driver."""
msg = _("Multiple hosts may be managed by the VMWare "

View File

@@ -646,9 +646,9 @@ class XenAPIDriver(driver.ComputeDriver):
"""Sets the compute host's ability to accept new instances."""
return self._host.set_host_enabled(enabled)
def get_host_uptime(self, host):
def get_host_uptime(self):
"""Returns the result of calling "uptime" on the target host."""
return self._host.get_host_uptime(host)
return self._host.get_host_uptime()
def host_maintenance_mode(self, host, mode):
"""Start/Stop host maintenance window. On start, it triggers

View File

@@ -132,7 +132,7 @@ class Host(object):
response = call_xenhost(self._session, "set_host_enabled", args)
return response.get("status", response)
def get_host_uptime(self, _host):
def get_host_uptime(self):
"""Returns the result of calling "uptime" on the target host."""
response = call_xenhost(self._session, "host_uptime", {})
return response.get("uptime", response)