summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
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 /tests/unittests/helpers.py
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 'tests/unittests/helpers.py')
-rw-r--r--tests/unittests/helpers.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index 972245df..de2cf638 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -256,7 +256,9 @@ def populate_dir(path, files):
if not os.path.exists(path):
os.makedirs(path)
for (name, content) in files.items():
- with open(os.path.join(path, name), "wb") as fp:
+ p = os.path.join(path, name)
+ util.ensure_dir(os.path.dirname(p))
+ with open(p, "wb") as fp:
if isinstance(content, six.binary_type):
fp.write(content)
else: