summaryrefslogtreecommitdiff
path: root/cloudinit/sources/helpers
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-08-11 06:34:06 -0600
committerScott Moser <smoser@ubuntu.com>2016-08-12 14:40:13 -0400
commitd9537aaa37f1e17db334c7cf8888ea3c4dcf1436 (patch)
treefd3a557c58f2b9376c6176526dbc2e2c6ab2e4f9 /cloudinit/sources/helpers
parent80db6eb9d697c21bfab85ab9a0dd5aceee571883 (diff)
downloadvyos-cloud-init-d9537aaa37f1e17db334c7cf8888ea3c4dcf1436.tar.gz
vyos-cloud-init-d9537aaa37f1e17db334c7cf8888ea3c4dcf1436.zip
MAAS: add vendor-data support
Add vendor-data support to maas which will behave like the openstack vendor-data does. Data returned from maas must be yaml loadable. Also update the main in DataSourceMAAS to "just work" on a maas deployed system. LP: #1612313
Diffstat (limited to 'cloudinit/sources/helpers')
-rw-r--r--cloudinit/sources/helpers/openstack.py25
1 files changed, 0 insertions, 25 deletions
diff --git a/cloudinit/sources/helpers/openstack.py b/cloudinit/sources/helpers/openstack.py
index 461fbd0d..84322e0e 100644
--- a/cloudinit/sources/helpers/openstack.py
+++ b/cloudinit/sources/helpers/openstack.py
@@ -621,28 +621,3 @@ def convert_net_json(network_json=None, known_macs=None):
config.append(cfg)
return {'version': 1, 'config': config}
-
-
-def convert_vendordata_json(data, recurse=True):
- """data: a loaded json *object* (strings, arrays, dicts).
- return something suitable for cloudinit vendordata_raw.
-
- if data is:
- None: return None
- string: return string
- list: return data
- the list is then processed in UserDataProcessor
- dict: return convert_vendordata_json(data.get('cloud-init'))
- """
- if not data:
- return None
- if isinstance(data, six.string_types):
- return data
- if isinstance(data, list):
- return copy.deepcopy(data)
- if isinstance(data, dict):
- if recurse is True:
- return convert_vendordata_json(data.get('cloud-init'),
- recurse=False)
- raise ValueError("vendordata['cloud-init'] cannot be dict")
- raise ValueError("Unknown data type for vendordata: %s" % type(data))