diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-07-31 17:09:48 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-07-31 17:09:48 +0000 |
| commit | 9d1c07d2f499082c30694d9a34319d97a3f9b4fd (patch) | |
| tree | 095e6f00ec6b39892d7cbf0066a2e929b3b20a50 | |
| parent | 5313ead49154ac53b6a35f1f89d65175f5b53054 (diff) | |
| parent | 2aaf430aab248d3ea10fe4987b39942ff3eb56df (diff) | |
Merge "Prefer instance in reboot_instance."
| -rw-r--r-- | nova/compute/manager.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 78d69becc..c9f484b6a 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1074,11 +1074,10 @@ class ComputeManager(manager.SchedulerDependentManager): def reboot_instance(self, context, instance=None, instance_uuid=None, reboot_type="SOFT"): """Reboot an instance on this host.""" - LOG.audit(_("Rebooting instance"), context=context, - instance_uuid=instance_uuid) context = context.elevated() if not instance: instance = self.db.instance_get_by_uuid(context, instance_uuid) + LOG.audit(_("Rebooting instance"), context=context, instance=instance) self._notify_about_instance_usage(context, instance, "reboot.start") @@ -1093,17 +1092,17 @@ class ComputeManager(manager.SchedulerDependentManager): LOG.warn(_('trying to reboot a non-running ' 'instance: (state: %(state)s ' 'expected: %(running)s)') % locals(), - context=context, instance_uuid=instance_uuid) + context=context, instance=instance) network_info = self._get_instance_nw_info(context, instance) try: self.driver.reboot(instance, self._legacy_nw_info(network_info), - reboot_type) + reboot_type) except Exception, exc: LOG.error(_('Cannot reboot instance: %(exc)s'), locals(), - context=context, instance_uuid=instance_uuid) - self.add_instance_fault_from_exc(context, instance_uuid, exc, - sys.exc_info()) + context=context, instance=instance) + self.add_instance_fault_from_exc(context, instance['uuid'], exc, + sys.exc_info()) # Fall through and reset task_state to None current_power_state = self._get_power_state(context, instance) |
