Merge lp:~justin-fathomdb/nova/merge-duplicate-periodic-task into lp:~hudson-openstack/nova/trunk

Proposed by justinsb
Status: Merged
Approved by: Vish Ishaya
Approved revision: 897
Merged at revision: 895
Proposed branch: lp:~justin-fathomdb/nova/merge-duplicate-periodic-task
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 49 lines (+13/-6)
2 files modified
nova/compute/manager.py (+9/-6)
nova/virt/driver.py (+4/-0)
To merge this branch: bzr merge lp:~justin-fathomdb/nova/merge-duplicate-periodic-task
Reviewer Review Type Date Requested Status
Vish Ishaya (community) Approve
Jay Pipes (community) Approve
Review via email: mp+55097@code.launchpad.net

Description of the change

Merged the two periodic_tasks functions, that snuck in due to parallel merges in compute.manager

To post a comment you must log in.
Revision history for this message
Thierry Carrez (ttx) wrote :

Created corresponding bug and linked it.

Revision history for this message
Jay Pipes (jaypipes) wrote :

lgtm.

review: Approve
Revision history for this message
Vish Ishaya (vishvananda) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/compute/manager.py'
2--- nova/compute/manager.py 2011-03-24 19:04:24 +0000
3+++ nova/compute/manager.py 2011-03-28 07:29:30 +0000
4@@ -141,12 +141,6 @@
5 """
6 self.driver.init_host(host=self.host)
7
8- def periodic_tasks(self, context=None):
9- """Tasks to be run at a periodic interval."""
10- super(ComputeManager, self).periodic_tasks(context)
11- if FLAGS.rescue_timeout > 0:
12- self.driver.poll_rescued_instances(FLAGS.rescue_timeout)
13-
14 def _update_state(self, context, instance_id):
15 """Update the state of an instance from the driver info."""
16 # FIXME(ja): include other fields from state?
17@@ -1033,11 +1027,20 @@
18 error_list = []
19
20 try:
21+ if FLAGS.rescue_timeout > 0:
22+ self.driver.poll_rescued_instances(FLAGS.rescue_timeout)
23+ except Exception as ex:
24+ LOG.warning(_("Error during poll_rescued_instances: %s"),
25+ unicode(ex))
26+ error_list.append(ex)
27+
28+ try:
29 self._poll_instance_states(context)
30 except Exception as ex:
31 LOG.warning(_("Error during instance poll: %s"),
32 unicode(ex))
33 error_list.append(ex)
34+
35 return error_list
36
37 def _poll_instance_states(self, context):
38
39=== modified file 'nova/virt/driver.py'
40--- nova/virt/driver.py 2011-03-24 15:40:14 +0000
41+++ nova/virt/driver.py 2011-03-28 07:29:30 +0000
42@@ -232,3 +232,7 @@
43 def inject_network_info(self, instance):
44 """inject network info for specified instance"""
45 raise NotImplementedError()
46+
47+ def poll_rescued_instances(self, timeout):
48+ """Poll for rescued instances"""
49+ raise NotImplementedError()