diff options
| author | Christopher MacGown <chris@pistoncloud.com> | 2011-08-22 21:06:47 -0700 |
|---|---|---|
| committer | Christopher MacGown <chris@pistoncloud.com> | 2011-08-22 21:06:47 -0700 |
| commit | 4c2674516897b6cce0441efe4ebb005c01cb3411 (patch) | |
| tree | 68c96d69847c64f6fe7d8c772087f4942f362ef4 /nova/virt | |
| parent | c4fc9f0737ec9f8d5c950b850fed9930a68164f4 (diff) | |
| download | nova-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.py | 2 | ||||
| -rw-r--r-- | nova/virt/xenapi/vm_utils.py | 2 | ||||
| -rw-r--r-- | nova/virt/xenapi/vmops.py | 5 |
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) |
