diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-07-05 21:08:51 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-07-05 21:08:51 +0000 |
| commit | fbb93679c5d69b3800c38931b670bb55cbbe1bb7 (patch) | |
| tree | 2d20782e12f59459012cf70a9883ba039d453251 | |
| parent | 050936e6223a920fc8112b914217f4739f2b8ed1 (diff) | |
| parent | ccdb02105acf32a4a0c81d688749475d8abedf4b (diff) | |
Merge "Don't catch & ignore exceptions when setting up LXC container filesystems"
| -rw-r--r-- | nova/virt/disk/api.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/nova/virt/disk/api.py b/nova/virt/disk/api.py index 3e66cd2a7..766c9ebd7 100644 --- a/nova/virt/disk/api.py +++ b/nova/virt/disk/api.py @@ -271,14 +271,15 @@ def setup_container(image, container_dir=None, use_cow=False): LXC does not support qcow2 images yet. """ - try: - img = _DiskImage(image=image, use_cow=use_cow, mount_dir=container_dir) - if img.mount(): - return img - else: - raise exception.NovaException(img.errors) - except Exception, exn: - LOG.exception(_('Failed to mount filesystem: %s'), exn) + img = _DiskImage(image=image, use_cow=use_cow, mount_dir=container_dir) + if img.mount(): + return img + else: + LOG.error(_("Failed to mount container filesystem '%(image)s' " + "on '%(target)s': %(errors)s") % + {"image": img, "target": container_dir, + "errors": img.errors}) + raise exception.NovaException(img.errors) def destroy_container(img): @@ -293,7 +294,7 @@ def destroy_container(img): if img: img.umount() except Exception, exn: - LOG.exception(_('Failed to remove container: %s'), exn) + LOG.exception(_('Failed to unmount container filesystem: %s'), exn) def inject_data_into_fs(fs, key, net, metadata, admin_password, execute): |
