diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-06-24 15:28:10 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-06-24 15:28:10 +0000 |
| commit | 4526cfc5238af18a338c928285c2e299c43bee8d (patch) | |
| tree | c88c0ae15dad444939eb0c03e51f7c7234bb083b /nova/virt | |
| parent | edcd837d060254f0d95ca2e2744a1a1208c91fd4 (diff) | |
| parent | 616098dcd36b20e01d38898b8942003df664e6ac (diff) | |
| download | nova-4526cfc5238af18a338c928285c2e299c43bee8d.tar.gz nova-4526cfc5238af18a338c928285c2e299c43bee8d.tar.xz nova-4526cfc5238af18a338c928285c2e299c43bee8d.zip | |
Merge "Do not raise NEW exceptions"
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/baremetal/db/sqlalchemy/api.py | 3 | ||||
| -rw-r--r-- | nova/virt/disk/vfs/localfs.py | 8 |
2 files changed, 5 insertions, 6 deletions
diff --git a/nova/virt/baremetal/db/sqlalchemy/api.py b/nova/virt/baremetal/db/sqlalchemy/api.py index 5c9c35184..3c140556e 100644 --- a/nova/virt/baremetal/db/sqlalchemy/api.py +++ b/nova/virt/baremetal/db/sqlalchemy/api.py @@ -297,8 +297,7 @@ def bm_interface_set_vif_uuid(context, if_id, vif_uuid): if str(e).find('IntegrityError') != -1: raise exception.NovaException(_("Baremetal interface %s " "already in use") % vif_uuid) - else: - raise e + raise @sqlalchemy_api.require_admin_context diff --git a/nova/virt/disk/vfs/localfs.py b/nova/virt/disk/vfs/localfs.py index 10b9a1aa8..735481340 100644 --- a/nova/virt/disk/vfs/localfs.py +++ b/nova/virt/disk/vfs/localfs.py @@ -18,6 +18,7 @@ import os import tempfile from nova import exception +from nova.openstack.common import excutils from nova.openstack.common import log as logging from nova import utils from nova.virt.disk.mount import loop @@ -77,10 +78,9 @@ class VFSLocalFS(vfs.VFS): raise exception.NovaException(mount.error) self.mount = mount except Exception as e: - LOG.debug(_("Failed to mount image %(ex)s)") % - {'ex': str(e)}) - self.teardown() - raise e + with excutils.save_and_reraise_exception(): + LOG.debug(_("Failed to mount image %(ex)s)"), {'ex': str(e)}) + self.teardown() def teardown(self): try: |
