summaryrefslogtreecommitdiff
path: root/cloudinit/sources/DataSourceConfigDrive.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-09-22 14:00:39 -0400
committerScott Moser <smoser@ubuntu.com>2014-09-22 14:00:39 -0400
commitb9f0bcbc087a0c7c4a87f83ddf5713a4f849a488 (patch)
tree186d80c155d32f75d8efa3c6ec1ad3562f11ba0a /cloudinit/sources/DataSourceConfigDrive.py
parent26e6c265277cf5e29b8af311f2bb8759b0e811cd (diff)
parentb76866ad72d433cc9008a137c464c7ed44401549 (diff)
downloadvyos-cloud-init-b9f0bcbc087a0c7c4a87f83ddf5713a4f849a488.tar.gz
vyos-cloud-init-b9f0bcbc087a0c7c4a87f83ddf5713a4f849a488.zip
merge from trunk
Diffstat (limited to 'cloudinit/sources/DataSourceConfigDrive.py')
-rw-r--r--cloudinit/sources/DataSourceConfigDrive.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py
index 82caf6eb..27658073 100644
--- a/cloudinit/sources/DataSourceConfigDrive.py
+++ b/cloudinit/sources/DataSourceConfigDrive.py
@@ -135,7 +135,15 @@ class DataSourceConfigDrive(openstack.SourceMixin, sources.DataSource):
self.userdata_raw = results.get('userdata')
self.version = results['version']
self.files.update(results.get('files', {}))
- self.vendordata_raw = results.get('vendordata')
+
+ vd = results.get('vendordata')
+ self.vendordata_pure = vd
+ try:
+ self.vendordata_raw = openstack.convert_vendordata_json(vd)
+ except ValueError as e:
+ LOG.warn("Invalid content in vendor-data: %s", e)
+ self.vendordata_raw = None
+
return True
@@ -170,10 +178,10 @@ def get_ds_mode(cfgdrv_ver, ds_cfg=None, user=None):
return "net"
-def read_config_drive(source_dir, version="2012-08-10"):
+def read_config_drive(source_dir):
reader = openstack.ConfigDriveReader(source_dir)
finders = [
- (reader.read_v2, [], {'version': version}),
+ (reader.read_v2, [], {}),
(reader.read_v1, [], {}),
]
excps = []