summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-01-29 14:32:51 -0500
committerScott Moser <smoser@ubuntu.com>2014-01-29 14:32:51 -0500
commit3cfe9b3d8958b1a4e450d5ff31d805c424945027 (patch)
treeb05977c13f4d8dbdb111b7392e2a5689ad381b84 /tests/unittests/helpers.py
parent06c80d8b0dcb8cf1013885fc745bf48d57b39ce4 (diff)
parent29b56e5ad6a5ec0eedbedcc598f633b1f5302a8a (diff)
downloadvyos-cloud-init-3cfe9b3d8958b1a4e450d5ff31d805c424945027.tar.gz
vyos-cloud-init-3cfe9b3d8958b1a4e450d5ff31d805c424945027.zip
DataSourceNoCloud: support reading vendor-data
Here we add the ability to read vendor-data from a file named vendor-data at the same location as the user-data and meta-data files. At the moment, vendor-data is not read at all from 'seedfrom'.
Diffstat (limited to 'tests/unittests/helpers.py')
-rw-r--r--tests/unittests/helpers.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index c0da0983..5b4f4208 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -187,7 +187,8 @@ class FilesystemMockingTestCase(ResourceUsingTestCase):
def populate_dir(path, files):
- os.makedirs(path)
+ if not os.path.exists(path):
+ os.makedirs(path)
for (name, content) in files.iteritems():
with open(os.path.join(path, name), "w") as fp:
fp.write(content)