summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorChristopher MacGown <chris@pistoncloud.com>2011-08-22 21:06:47 -0700
committerChristopher MacGown <chris@pistoncloud.com>2011-08-22 21:06:47 -0700
commit4c2674516897b6cce0441efe4ebb005c01cb3411 (patch)
tree68c96d69847c64f6fe7d8c772087f4942f362ef4 /nova/virt
parentc4fc9f0737ec9f8d5c950b850fed9930a68164f4 (diff)
downloadnova-4c2674516897b6cce0441efe4ebb005c01cb3411.tar.gz
nova-4c2674516897b6cce0441efe4ebb005c01cb3411.tar.xz
nova-4c2674516897b6cce0441efe4ebb005c01cb3411.zip
Added the fixes suggested by Eric Windisch from cloudscaling...
Diffstat (limited to 'nova/virt')
-rw-r--r--nova/virt/disk.py2
-rw-r--r--nova/virt/xenapi/vm_utils.py2
-rw-r--r--nova/virt/xenapi/vmops.py5
3 files changed, 5 insertions, 4 deletions
diff --git a/nova/virt/disk.py b/nova/virt/disk.py
index 54b191fa9..809d3323c 100644
--- a/nova/virt/disk.py
+++ b/nova/virt/disk.py
@@ -228,7 +228,7 @@ def _inject_metadata_into_fs(metadata, fs, execute=None):
metadata_path = os.path.join(fs, "meta.js")
metadata = dict([(m.key, m.value) for m in metadata])
- utils.execute('sudo', 'tee', '-a', metadata_path,
+ utils.execute('sudo', 'tee', metadata_path,
process_input=json.dumps(metadata))
diff --git a/nova/virt/xenapi/vm_utils.py b/nova/virt/xenapi/vm_utils.py
index 3861f6bd8..e517dcf28 100644
--- a/nova/virt/xenapi/vm_utils.py
+++ b/nova/virt/xenapi/vm_utils.py
@@ -641,7 +641,7 @@ class VMHelper(HelperBase):
# everything
mount_required = False
key, net, metadata = _prepare_injectables(instance, network_info)
- mount_required = key or net
+ mount_required = key or net or metadata
if not mount_required:
return
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py
index b1522729a..606041d12 100644
--- a/nova/virt/xenapi/vmops.py
+++ b/nova/virt/xenapi/vmops.py
@@ -251,8 +251,9 @@ class VMOps(object):
bootable=False)
userdevice += 1
- # Alter the image before VM start for, e.g. network injection
- if FLAGS.flat_injected:
+ # Alter the image before VM start for, e.g. network injection also
+ # alter the image if there's metadata.
+ if FLAGS.flat_injected or instance['metadata']:
VMHelper.preconfigure_instance(self._session, instance,
first_vdi_ref, network_info)