summaryrefslogtreecommitdiff
path: root/tests/unittests/helpers.py
diff options
context:
space:
mode:
authorDaniel Watkins <daniel.watkins@canonical.com>2015-02-18 13:30:51 +0000
committerDaniel Watkins <daniel.watkins@canonical.com>2015-02-18 13:30:51 +0000
commit589ced475c9e200d4645f0b06f7846dae412b194 (patch)
tree2670497ceaaecf2e943d691b0ccf2f916beebb07 /tests/unittests/helpers.py
parentd47a6e5bf47287c50932812a5b64f763b8abcbe9 (diff)
downloadvyos-cloud-init-589ced475c9e200d4645f0b06f7846dae412b194.tar.gz
vyos-cloud-init-589ced475c9e200d4645f0b06f7846dae412b194.zip
Read ovf-env.xml as bytes.
This should fix the Azure data source on Python 3, and is appropriate as XML shouldn't really be read as a string.
Diffstat (limited to 'tests/unittests/helpers.py')
-rw-r--r--tests/unittests/helpers.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index ce77af93..7516bd02 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -287,10 +287,11 @@ 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), "w") as fp:
- fp.write(content)
+ with open(os.path.join(path, name), "wb") as fp:
+ fp.write(content.encode('utf-8'))
fp.close()
+
try:
skipIf = unittest.skipIf
except AttributeError: