diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-04-16 18:23:18 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-04-16 18:23:18 +0000 |
commit | 964df95013fe65d38b3675592ae02249e93d2bc5 (patch) | |
tree | 2fa348defb87ec01edf0859533870c4d977ab6f9 | |
parent | 36b10384724fec9657784980cd2bd38e72b445bc (diff) | |
parent | a2a9f16889b5b74de0daccab3e5011ad0f4d1e94 (diff) | |
download | nova-964df95013fe65d38b3675592ae02249e93d2bc5.tar.gz nova-964df95013fe65d38b3675592ae02249e93d2bc5.tar.xz nova-964df95013fe65d38b3675592ae02249e93d2bc5.zip |
Merge "xenapi: Make _connect_volume exc handler eventlet safe"
-rw-r--r-- | nova/virt/xenapi/volumeops.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/nova/virt/xenapi/volumeops.py b/nova/virt/xenapi/volumeops.py index add3787a3..f31284ee3 100644 --- a/nova/virt/xenapi/volumeops.py +++ b/nova/virt/xenapi/volumeops.py @@ -20,6 +20,7 @@ Management class for Storage-related functions (attach, detach, etc). """ from nova import exception +from nova.openstack.common import excutils from nova.openstack.common import log as logging from nova.virt.xenapi import vm_utils from nova.virt.xenapi import volume_utils @@ -92,10 +93,11 @@ class VolumeOps(object): if hotplug: self._session.call_xenapi("VBD.plug", vbd_ref) except Exception: - # NOTE(sirp): Forgetting the SR will have the effect of cleaning up - # the VDI and VBD records, so no need to handle that explicitly. - volume_utils.forget_sr(self._session, sr_ref) - raise + with excutils.save_and_reraise_exception(): + # NOTE(sirp): Forgetting the SR will have the effect of + # cleaning up the VDI and VBD records, so no need to handle + # that explicitly. + volume_utils.forget_sr(self._session, sr_ref) def detach_volume(self, connection_info, instance_name, mountpoint): """Detach volume storage to VM instance.""" |