From 2f5d4cebb243cf2f30c665f034668ba4b14178f9 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 15 Mar 2018 12:39:32 -0400 Subject: tests: fix run_tree and bddeb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was broken probably when we inserted the ssh keys into Platform.   tox -e citest tree_run and   tox -e citest bddeb would fail with KeyError in Platform.init due to lack of a data_dir. Also here are a few fixes found from attempting to make it work. --- tests/cloud_tests/util.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/cloud_tests/util.py') diff --git a/tests/cloud_tests/util.py b/tests/cloud_tests/util.py index 6ff285e7..3dd4996d 100644 --- a/tests/cloud_tests/util.py +++ b/tests/cloud_tests/util.py @@ -460,6 +460,10 @@ class PlatformError(IOError): IOError.__init__(self, message) +def mkdtemp(prefix='cloud_test_data'): + return tempfile.mkdtemp(prefix=prefix) + + class TempDir(object): """Configurable temporary directory like tempfile.TemporaryDirectory.""" @@ -480,7 +484,7 @@ class TempDir(object): @return_value: tempdir path """ if not self.tmpdir: - self.tmpdir = tempfile.mkdtemp(prefix=self.prefix) + self.tmpdir = mkdtemp(prefix=self.prefix) LOG.debug('using tmpdir: %s', self.tmpdir) return self.tmpdir -- cgit v1.2.3