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
=== modified file 'nova/compute/manager.py'
--- nova/compute/manager.py 2011-03-24 19:04:24 +0000
+++ nova/compute/manager.py 2011-03-28 07:29:30 +0000
@@ -141,12 +141,6 @@
141 """141 """
142 self.driver.init_host(host=self.host)142 self.driver.init_host(host=self.host)
143143
144 def periodic_tasks(self, context=None):
145 """Tasks to be run at a periodic interval."""
146 super(ComputeManager, self).periodic_tasks(context)
147 if FLAGS.rescue_timeout > 0:
148 self.driver.poll_rescued_instances(FLAGS.rescue_timeout)
149
150 def _update_state(self, context, instance_id):144 def _update_state(self, context, instance_id):
151 """Update the state of an instance from the driver info."""145 """Update the state of an instance from the driver info."""
152 # FIXME(ja): include other fields from state?146 # FIXME(ja): include other fields from state?
@@ -1033,11 +1027,20 @@
1033 error_list = []1027 error_list = []
10341028
1035 try:1029 try:
1030 if FLAGS.rescue_timeout > 0:
1031 self.driver.poll_rescued_instances(FLAGS.rescue_timeout)
1032 except Exception as ex:
1033 LOG.warning(_("Error during poll_rescued_instances: %s"),
1034 unicode(ex))
1035 error_list.append(ex)
1036
1037 try:
1036 self._poll_instance_states(context)1038 self._poll_instance_states(context)
1037 except Exception as ex:1039 except Exception as ex:
1038 LOG.warning(_("Error during instance poll: %s"),1040 LOG.warning(_("Error during instance poll: %s"),
1039 unicode(ex))1041 unicode(ex))
1040 error_list.append(ex)1042 error_list.append(ex)
1043
1041 return error_list1044 return error_list
10421045
1043 def _poll_instance_states(self, context):1046 def _poll_instance_states(self, context):
10441047
=== modified file 'nova/virt/driver.py'
--- nova/virt/driver.py 2011-03-24 15:40:14 +0000
+++ nova/virt/driver.py 2011-03-28 07:29:30 +0000
@@ -232,3 +232,7 @@
232 def inject_network_info(self, instance):232 def inject_network_info(self, instance):
233 """inject network info for specified instance"""233 """inject network info for specified instance"""
234 raise NotImplementedError()234 raise NotImplementedError()
235
236 def poll_rescued_instances(self, timeout):
237 """Poll for rescued instances"""
238 raise NotImplementedError()