summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoren Hansen <soren@linux2go.dk>2011-08-05 15:38:25 +0200
committerSoren Hansen <soren@linux2go.dk>2011-08-05 15:38:25 +0200
commit070d832dad062dfb18439e77b4460e6ebe75bdb0 (patch)
tree373dc228ac1c113986a05ac90ce26c1bd7d2c634
parent1e366d9de180347b47675bf7f811ffd5a293ef10 (diff)
downloadnova-070d832dad062dfb18439e77b4460e6ebe75bdb0.tar.gz
nova-070d832dad062dfb18439e77b4460e6ebe75bdb0.tar.xz
nova-070d832dad062dfb18439e77b4460e6ebe75bdb0.zip
Make disk_format and container_format optional for libvirt's snapshot implementation.
-rw-r--r--nova/virt/libvirt/connection.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/nova/virt/libvirt/connection.py b/nova/virt/libvirt/connection.py
index 0b93a8399..3663337e9 100644
--- a/nova/virt/libvirt/connection.py
+++ b/nova/virt/libvirt/connection.py
@@ -392,9 +392,7 @@ class LibvirtConnection(driver.ComputeDriver):
nova.image.get_image_service(image_href)
snapshot = snapshot_image_service.show(context, snapshot_image_id)
- metadata = {'disk_format': base['disk_format'],
- 'container_format': base['container_format'],
- 'is_public': False,
+ metadata = {'is_public': False,
'status': 'active',
'name': snapshot['name'],
'properties': {
@@ -409,6 +407,12 @@ class LibvirtConnection(driver.ComputeDriver):
arch = base['properties']['architecture']
metadata['properties']['architecture'] = arch
+ if 'disk_format' in base:
+ metadata['disk_format'] = base['disk_format']
+
+ if 'container_format' in base:
+ metadata['container_format'] = base['container_format']
+
# Make the snapshot
snapshot_name = uuid.uuid4().hex
snapshot_xml = """