Merge "Make sure domain exists before referencing it" into stable/icehouse
This commit is contained in:
commit
678b00e028
@ -3647,6 +3647,7 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
events = []
|
||||
|
||||
launch_flags = events and libvirt.VIR_DOMAIN_START_PAUSED or 0
|
||||
domain = None
|
||||
try:
|
||||
with self.virtapi.wait_for_instance_event(
|
||||
instance, events, deadline=timeout,
|
||||
@ -3666,7 +3667,8 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
except exception.NovaException:
|
||||
# Neutron reported failure and we didn't swallow it, so
|
||||
# bail here
|
||||
domain.destroy()
|
||||
if domain:
|
||||
domain.destroy()
|
||||
self.cleanup(context, instance, network_info=network_info,
|
||||
block_device_info=block_device_info)
|
||||
raise exception.VirtualInterfaceCreateException()
|
||||
@ -3675,7 +3677,8 @@ class LibvirtDriver(driver.ComputeDriver):
|
||||
LOG.warn(_('Timeout waiting for vif plugging callback for '
|
||||
'instance %(uuid)s'), {'uuid': instance['uuid']})
|
||||
if CONF.vif_plugging_is_fatal:
|
||||
domain.destroy()
|
||||
if domain:
|
||||
domain.destroy()
|
||||
self.cleanup(context, instance, network_info=network_info,
|
||||
block_device_info=block_device_info)
|
||||
raise exception.VirtualInterfaceCreateException()
|
||||
|
Loading…
Reference in New Issue
Block a user