summaryrefslogtreecommitdiff
path: root/cloudinit/sources/helpers/openstack.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-03-24 15:07:41 -0400
committerScott Moser <smoser@ubuntu.com>2016-03-24 15:07:41 -0400
commita7053201e892f6401752e17998700d027d23ea89 (patch)
tree574da3509fb196872de979e01db33aab0ca27ce4 /cloudinit/sources/helpers/openstack.py
parent5eedd9e6f15a49029e00aca83f863c89fdb6d198 (diff)
parent9c0b3fc96fc33107dde8e89b02a63dbfb04e207c (diff)
downloadvyos-cloud-init-a7053201e892f6401752e17998700d027d23ea89.tar.gz
vyos-cloud-init-a7053201e892f6401752e17998700d027d23ea89.zip
ConfigDrive: convert OpenStack network_data.json to network_config.yaml
OpenStack clouds may provide network_data.json information via the MetadataService in ConfigDrive. Teach ConfigDrive to read, store and convert the data into network_config yaml format. Making this available allows cloud-init to read network config from OpenStack and use the distro.apply_network_config() method to render the network_config from OpenStack into a distro network configuration file.
Diffstat (limited to 'cloudinit/sources/helpers/openstack.py')
-rw-r--r--cloudinit/sources/helpers/openstack.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index bd93d22f..1aa6bbae 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -51,11 +51,13 @@ OS_LATEST = 'latest'
OS_FOLSOM = '2012-08-10'
OS_GRIZZLY = '2013-04-04'
OS_HAVANA = '2013-10-17'
+OS_LIBERTY = '2015-10-15'
# keep this in chronological order. new supported versions go at the end.
OS_VERSIONS = (
OS_FOLSOM,
OS_GRIZZLY,
OS_HAVANA,
+ OS_LIBERTY,
)
@@ -229,6 +231,11 @@ class BaseReader(object):
False,
load_json_anytype,
)
+ files['networkdata'] = (
+ self._path_join("openstack", version, 'network_data.json'),
+ False,
+ load_json_anytype,
+ )
return files
results = {
@@ -334,7 +341,7 @@ class ConfigDriveReader(BaseReader):
path = self._path_join(self.base_path, 'openstack')
found = [d for d in os.listdir(path)
if os.path.isdir(os.path.join(path))]
- self._versions = found
+ self._versions = sorted(found)
return self._versions
def _read_ec2_metadata(self):