Syncs with nova

There are some small differences in the projects due to a few patches.
Solves the differences.

Change-Id: I6ef3890f23b4bdb9a8a3bb615f19f06d6276b1fc
This commit is contained in:
Claudiu Belu
2015-09-17 20:19:22 +03:00
parent 6e4fdbb122
commit 0cd85e1a56
4 changed files with 14 additions and 6 deletions

View File

@@ -77,7 +77,7 @@ class InstanceEventHandler(object):
def _poll_events(self):
while True:
try:
# Retrieve one by one all the events that occured in
# Retrieve one by one all the events that occurred in
# the checked interval.
event = self._listener(self._WAIT_TIMEOUT)
self._dispatch_event(event)

View File

@@ -193,7 +193,7 @@ class HostOps(object):
# format the string to match libvirt driver uptime
# Libvirt uptime returns a combination of the following
# - curent host time
# - current host time
# - time since host is up
# - number of logged in users
# - cpu load

View File

@@ -282,7 +282,7 @@ class PathUtils(object):
except wmi.x_wmi as exc:
err_msg = (_(
'Unable to mount SMBFS share: %(smbfs_share)s '
'WMI exception: %(wmi_exc)s'), {'smbfs_share': smbfs_share,
'WMI exception: %(wmi_exc)s') % {'smbfs_share': smbfs_share,
'wmi_exc': exc})
raise vmutils.HyperVException(err_msg)
@@ -306,4 +306,4 @@ class PathUtils(object):
# case.
if force:
raise vmutils.HyperVException(
_("Could not unmount share: %s"), smbfs_share)
_("Could not unmount share: %s") % smbfs_share)

View File

@@ -528,6 +528,8 @@ class VMOps(object):
LOG.info(_LI("Got request to destroy instance"), instance=instance)
try:
if self._vmutils.vm_exists(instance_name):
# Stop the VM first.
self._vmutils.stop_vm_jobs(instance_name)
self.power_off(instance)
@@ -629,6 +631,7 @@ class VMOps(object):
if retry_interval <= 0:
retry_interval = SHUTDOWN_TIME_INCREMENT
try:
if timeout and self._soft_shutdown(instance,
timeout,
@@ -638,7 +641,12 @@ class VMOps(object):
self._set_vm_state(instance,
constants.HYPERV_VM_STATE_DISABLED)
except exception.InstanceNotFound:
pass
# The manager can call the stop API after receiving instance
# power off events. If this is triggered when the instance
# is being deleted, it might attempt to power off an unexisting
# instance. We'll just pass in this case.
LOG.debug("Instance not found. Skipping power off",
instance=instance)
def power_on(self, instance, block_device_info=None, network_info=None):
"""Power on the specified instance."""