summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-08-02 01:34:12 +0000
committerGerrit Code Review <review@openstack.org>2012-08-02 01:34:12 +0000
commitfe21967c6afce187e250efc2976ecd0b06e724c8 (patch)
treecd3b600c981a4af5f7170120367692f903a15e1b /nova
parent997250d43ee953ae25892213110b9a12860f8377 (diff)
parent9893c3eb5794e689736e881ec0551bdfeda48d8f (diff)
Merge "Remove agent_update from the compute manager."
Diffstat (limited to 'nova')
-rw-r--r--nova/compute/manager.py18
-rw-r--r--nova/tests/compute/test_compute.py20
-rw-r--r--nova/tests/test_virt_drivers.py6
-rw-r--r--nova/virt/driver.py13
-rw-r--r--nova/virt/fake.py3
5 files changed, 0 insertions, 60 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 85a0a13ad..3d9e61186 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -1306,24 +1306,6 @@ class ComputeManager(manager.SchedulerDependentManager):
@exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
@checks_instance_lock
@wrap_instance_fault
- def agent_update(self, context, instance_uuid, url, md5hash):
- """Update agent running on an instance on this host."""
- context = context.elevated()
- instance_ref = self.db.instance_get_by_uuid(context, instance_uuid)
- current_power_state = self._get_power_state(context, instance_ref)
- expected_state = power_state.RUNNING
- if current_power_state != expected_state:
- LOG.warn(_('trying to update agent on a non-running '
- '(state: %(current_power_state)s '
- 'expected: %(expected_state)s)') % locals(),
- instance=instance_ref)
- LOG.audit(_('updating agent to %(url)s') % locals(),
- instance=instance_ref)
- self.driver.agent_update(instance_ref, url, md5hash)
-
- @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id())
- @checks_instance_lock
- @wrap_instance_fault
def rescue_instance(self, context, instance=None, instance_uuid=None,
rescue_password=None):
"""
diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py
index 4988a4be9..d59753d58 100644
--- a/nova/tests/compute/test_compute.py
+++ b/nova/tests/compute/test_compute.py
@@ -766,26 +766,6 @@ class ComputeTestCase(BaseTestCase):
self.compute.terminate_instance(self.context, instance=instance)
- def test_agent_update(self):
- """Ensure instance can have its agent updated"""
- called = {'agent_update': False}
-
- def fake_driver_agent_update(self2, instance, url, md5hash):
- called['agent_update'] = True
- self.assertEqual(url, 'http://fake/url/')
- self.assertEqual(md5hash, 'fakehash')
-
- self.stubs.Set(nova.virt.fake.FakeDriver, 'agent_update',
- fake_driver_agent_update)
-
- instance = self._create_fake_instance()
- self.compute.run_instance(self.context, instance['uuid'])
- self.compute.agent_update(self.context, instance['uuid'],
- 'http://fake/url/', 'fakehash')
- self.assertTrue(called['agent_update'])
- self.compute.terminate_instance(self.context,
- instance=jsonutils.to_primitive(instance))
-
def test_snapshot(self):
"""Ensure instance can be snapshotted"""
instance = jsonutils.to_primitive(self._create_fake_instance())
diff --git a/nova/tests/test_virt_drivers.py b/nova/tests/test_virt_drivers.py
index b724c2276..fb109731f 100644
--- a/nova/tests/test_virt_drivers.py
+++ b/nova/tests/test_virt_drivers.py
@@ -259,12 +259,6 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
base64.b64encode('testcontents'))
@catch_notimplementederror
- def test_agent_update(self):
- instance_ref, network_info = self._get_running_instance()
- self.connection.agent_update(instance_ref, 'http://www.openstack.org/',
- 'd41d8cd98f00b204e9800998ecf8427e')
-
- @catch_notimplementederror
def test_resume_state_on_host_boot(self):
instance_ref, network_info = self._get_running_instance()
self.connection.resume_state_on_host_boot(self.ctxt, instance_ref,
diff --git a/nova/virt/driver.py b/nova/virt/driver.py
index 4e821eab2..262c4c3ef 100644
--- a/nova/virt/driver.py
+++ b/nova/virt/driver.py
@@ -539,19 +539,6 @@ class ComputeDriver(object):
"""
pass
- def agent_update(self, instance, url, md5hash):
- """
- Update agent on the specified instance.
-
- The first parameter is an instance of nova.compute.service.Instance,
- and so the instance is being specified as instance.name. The second
- parameter is the URL of the agent to be fetched and updated on the
- instance; the third is the md5 hash of the file for verification
- purposes.
- """
- # TODO(Vek): Need to pass context in for access to auth_token
- raise NotImplementedError()
-
def inject_network_info(self, instance, nw_info):
"""inject network info for specified instance"""
# TODO(Vek): Need to pass context in for access to auth_token
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index cf143480b..0e5443074 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -114,9 +114,6 @@ class FakeDriver(driver.ComputeDriver):
def inject_file(self, instance, b64_path, b64_contents):
pass
- def agent_update(self, instance, url, md5hash):
- pass
-
def resume_state_on_host_boot(self, context, instance, network_info):
pass