summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2016-08-12 17:05:04 -0400
committerScott Moser <smoser@brickies.net>2016-08-12 17:05:04 -0400
commitbf1728902bd3e81e00aa9786a5b1c67e4f30a659 (patch)
tree857c914003fda2ec5223425a31b646cbafd9907b /tests/unittests/helpers.py
parente28ba310872846e0bc60595aed353c17b760fdcb (diff)
parentbc2c3267549b9067c017a34e22bbee18890aec06 (diff)
downloadvyos-cloud-init-bf1728902bd3e81e00aa9786a5b1c67e4f30a659.tar.gz
vyos-cloud-init-bf1728902bd3e81e00aa9786a5b1c67e4f30a659.zip
Merge branch 'master' into ubuntu/devel
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: