diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-08-24 16:51:16 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-08-24 16:51:16 -0400 |
commit | cd47f4a6ae1249c3b516259edaa79fcc80a5990b (patch) | |
tree | 136fed96c2e47c484e563f66e7f9752662c3829f | |
parent | 7a6543aebc06157c1ec2ee78dc086a84490e2a25 (diff) | |
download | vyos-cloud-init-cd47f4a6ae1249c3b516259edaa79fcc80a5990b.tar.gz vyos-cloud-init-cd47f4a6ae1249c3b516259edaa79fcc80a5990b.zip |
use 'uuid' as 'instance-id'
openstack metadata uses 'uuid' as an instances 'instance-id'.
just copy that to the metadata['instance-id']
-rw-r--r-- | cloudinit/sources/DataSourceConfigDrive.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py index b68a97bb..585dbb58 100644 --- a/cloudinit/sources/DataSourceConfigDrive.py +++ b/cloudinit/sources/DataSourceConfigDrive.py @@ -237,6 +237,13 @@ def read_config_drive_dir_v2(source_dir, version="latest"): if found: results[name] = data + # instance-id is 'uuid' for openstack. just copy it to instance-id. + if 'instance-id' not in results['metadata']: + try: + results['metadata']['instance-id'] = results['metadata']['uuid'] + except KeyError: + raise BrokenConfigDriveDir("No uuid entry in metadata") + def read_content_path(item): # do not use os.path.join here, as content_path starts with / cpath = os.path.sep.join((source_dir, "openstack", |