summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2014-01-27 13:03:55 -0500
committerScott Moser <smoser@ubuntu.com>2014-01-27 13:03:55 -0500
commitf405a5283ede1e0af09eb8bf0dbe5046680641b5 (patch)
tree7f5b7b8e6ed620b1cab8d8f46495362c3d9ed865
parent0be4922d92e874b2e3300bdde65829cdb6569524 (diff)
downloadvyos-cloud-init-f405a5283ede1e0af09eb8bf0dbe5046680641b5.tar.gz
vyos-cloud-init-f405a5283ede1e0af09eb8bf0dbe5046680641b5.zip
populate_dir: only makedir if it doesn't exist
-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)