summaryrefslogtreecommitdiff
path: root/tests/unittests/test_runs/test_simple_run.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-02-10 20:53:20 -0500
committerScott Moser <smoser@ubuntu.com>2015-02-10 20:53:20 -0500
commitcd632b2f153a61faa48531cb41d0288650e72c71 (patch)
treea3a35b9ca437d999a15fdd25c0a0de88e3cafafb /tests/unittests/test_runs/test_simple_run.py
parent78915c97c18d678db10e0fde0d9306823c5f4610 (diff)
parentf5f280cae778bd214b91664f28d9eed997fbcda5 (diff)
downloadvyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.tar.gz
vyos-cloud-init-cd632b2f153a61faa48531cb41d0288650e72c71.zip
python3 support.
This gives us functional python3 support. There are likely still bugs, but instance boot on openstack is functional now. LP: #1247132
Diffstat (limited to 'tests/unittests/test_runs/test_simple_run.py')
-rw-r--r--tests/unittests/test_runs/test_simple_run.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/unittests/test_runs/test_simple_run.py b/tests/unittests/test_runs/test_simple_run.py
index c9ba949e..e19e65cd 100644
--- a/tests/unittests/test_runs/test_simple_run.py
+++ b/tests/unittests/test_runs/test_simple_run.py
@@ -1,20 +1,20 @@
import os
+import shutil
+import tempfile
from .. import helpers
-from cloudinit.settings import (PER_INSTANCE)
+from cloudinit.settings import PER_INSTANCE
from cloudinit import stages
from cloudinit import util
class TestSimpleRun(helpers.FilesystemMockingTestCase):
def _patchIn(self, root):
- self.restore()
self.patchOS(root)
self.patchUtils(root)
def _pp_root(self, root, repatch=True):
- self.restore()
for (dirpath, dirnames, filenames) in os.walk(root):
print(dirpath)
for f in filenames:
@@ -33,7 +33,8 @@ class TestSimpleRun(helpers.FilesystemMockingTestCase):
self._patchIn(root)
def test_none_ds(self):
- new_root = self.makeDir()
+ new_root = tempfile.mkdtemp()
+ self.addCleanup(shutil.rmtree, new_root)
self.replicateTestRoot('simple_ubuntu', new_root)
cfg = {
'datasource_list': ['None'],
@@ -41,7 +42,7 @@ class TestSimpleRun(helpers.FilesystemMockingTestCase):
{
'path': '/etc/blah.ini',
'content': 'blah',
- 'permissions': 0755,
+ 'permissions': 0o755,
},
],
'cloud_init_modules': ['write-files'],