diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-08-24 17:06:18 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-08-24 17:06:18 -0400 |
commit | c883c28c8abd00e9681ddcee97ac2f1ab5b33883 (patch) | |
tree | cb35ad181db9d492ccf7374f17d39d5f32a4e474 /cloudinit/sources | |
parent | 0a84d4e669913fe221a61a34641252d6b172299f (diff) | |
download | vyos-cloud-init-c883c28c8abd00e9681ddcee97ac2f1ab5b33883.tar.gz vyos-cloud-init-c883c28c8abd00e9681ddcee97ac2f1ab5b33883.zip |
use openstack metadata version 2012-08-10 unless not available
If 'latest' is found, but '2012-08-10' is not, we will log a warning
but attempt to use it.
Diffstat (limited to 'cloudinit/sources')
-rw-r--r-- | cloudinit/sources/DataSourceConfigDrive.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py index 558e773c..b8154367 100644 --- a/cloudinit/sources/DataSourceConfigDrive.py +++ b/cloudinit/sources/DataSourceConfigDrive.py @@ -205,7 +205,14 @@ def read_config_drive_dir(source_dir): raise last_e -def read_config_drive_dir_v2(source_dir, version="latest"): +def read_config_drive_dir_v2(source_dir, version="2012-08-10"): + + if (not os.path.isdir(os.path.join(source_dir, "openstack", version)) and + os.path.isdir(os.path.join(source_dir, "openstack", "latest"))): + LOG.warn("version '%s' not available, attempting to use 'latest'" % + version) + version = "latest" + datafiles = ( ('metadata', "openstack/%s/meta_data.json" % version, True, json.loads), |