summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-11-12 11:57:14 -0500
committerScott Moser <smoser@ubuntu.com>2012-11-12 11:57:14 -0500
commit2fabf3951d79ba67455a00895b5357fccf28f4f3 (patch)
treec944285e56b284812c7137af53a6d278b7e80c32 /cloudinit
parent7446280d1398f7dc8ad74a792416cd82a5873d67 (diff)
downloadvyos-cloud-init-2fabf3951d79ba67455a00895b5357fccf28f4f3.tar.gz
vyos-cloud-init-2fabf3951d79ba67455a00895b5357fccf28f4f3.zip
REVERT revno 714: config-drive-v2: populate metadata['public-keys'] from 'public_keys'
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/sources/DataSourceConfigDrive.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py
index dbbedce1..9729cfb9 100644
--- a/cloudinit/sources/DataSourceConfigDrive.py
+++ b/cloudinit/sources/DataSourceConfigDrive.py
@@ -218,6 +218,11 @@ class DataSourceConfigDrive(sources.DataSource):
return True
+ def get_public_ssh_keys(self):
+ if not 'public-keys' in self.metadata:
+ return []
+ return self.metadata['public-keys']
+
class DataSourceConfigDriveNet(DataSourceConfigDrive):
def __init__(self, sys_cfg, distro, paths):
@@ -326,13 +331,6 @@ def read_config_drive_dir_v2(source_dir, version="2012-08-10"):
except KeyError:
raise BrokenConfigDriveDir("No uuid entry in metadata")
- # other datasources (and config-drive-v1) populate metadata['public-keys']
- # where as with config-drive-v2, that would be 'public_keys'. So, just
- # copy the field if it is present
- if ('public_keys' in results['metadata'] and not
- 'public-keys' in results['metadata']):
- results['public-keys'] = results['public_keys']
-
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",