diff options
| author | Brian Lamar <brian.lamar@rackspace.com> | 2011-04-12 09:34:52 -0400 |
|---|---|---|
| committer | Brian Lamar <brian.lamar@rackspace.com> | 2011-04-12 09:34:52 -0400 |
| commit | 764862180657dbc16b2d57d3b2027c23b86ea649 (patch) | |
| tree | 4ca8de7c18d21672c2cd63119091cc90c50d1489 /nova | |
| parent | 2738e49b48da20ba382d0cdb1afddd369c06e74f (diff) | |
Reverted some superfluous changes to make MP more concise.
Diffstat (limited to 'nova')
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 6ed065280..135e59a34 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -206,27 +206,27 @@ class VMOps(object): # NOTE(armando): Do we really need to do this in virt? # NOTE(tr3buchet): not sure but wherever we do it, we need to call # reset_network afterwards + timer = utils.LoopingCall(f=None) def _wait_for_boot(): try: state = self.get_info(instance_name)['state'] - except self.XenAPI.Failure as ex: - msg = _("Error while waiting for VM '%(instance_name)s' " - "to boot: %(ex)s") % locals() - LOG.debug(msg) + if state == power_state.RUNNING: + LOG.debug(_('Instance %s: booted'), instance_name) + timer.stop() + _inject_files() + return True + except Exception, exc: + LOG.warn(exc) + LOG.exception(_('Instance %s: failed to boot'), instance_name) timer.stop() return False - if state == power_state.RUNNING: - LOG.debug(_('VM %s is now running.') % instance_name) - timer.stop() - _inject_files() - return True + timer.f = _wait_for_boot # call to reset network to configure network from xenstore self.reset_network(instance, vm_ref) - timer = utils.LoopingCall(f=_wait_for_boot) return timer.start(interval=0.5, now=True) def _get_vm_opaque_ref(self, instance_or_vm): |
