summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPádraig Brady <pbrady@redhat.com>2012-01-12 16:40:12 +0000
committerPádraig Brady <pbrady@redhat.com>2012-01-12 16:40:12 +0000
commit144c4f954ee874982c369da60a9a794e2dca7df9 (patch)
tree8b861b1a716882d632722a709f53e7601677dac5
parent475691a4bd5795feb50b5c9ccfe98e6487390e58 (diff)
improve handling of the img_handlers config list
Allow a 'loop' entry to be optional. Also improve the diagnostic with an empty or non capable list. Change-Id: Iec395497e43d1e84adbfc5f29a7bce82d4f91587
-rw-r--r--nova/virt/disk/api.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/virt/disk/api.py b/nova/virt/disk/api.py
index 47d56c954..9a457a318 100644
--- a/nova/virt/disk/api.py
+++ b/nova/virt/disk/api.py
@@ -120,9 +120,12 @@ class _DiskImage(object):
# As a performance tweak, don't bother trying to
# directly loopback mount a cow image.
self.handlers = FLAGS.img_handlers[:]
- if use_cow:
+ if use_cow and 'loop' in self.handlers:
self.handlers.remove('loop')
+ if not self.handlers:
+ raise exception.Error(_('no capable image handler configured'))
+
@property
def errors(self):
"""Return the collated errors from all operations."""