diff options
author | Scott Moser <smoser@ubuntu.com> | 2014-09-22 14:00:39 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2014-09-22 14:00:39 -0400 |
commit | b9f0bcbc087a0c7c4a87f83ddf5713a4f849a488 (patch) | |
tree | 186d80c155d32f75d8efa3c6ec1ad3562f11ba0a /cloudinit/sources/DataSourceConfigDrive.py | |
parent | 26e6c265277cf5e29b8af311f2bb8759b0e811cd (diff) | |
parent | b76866ad72d433cc9008a137c464c7ed44401549 (diff) | |
download | vyos-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.py | 14 |
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 = [] |