summaryrefslogtreecommitdiff
path: root/cloudinit/cmd/tests/test_clean.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-11 21:15:45 +0100
committerGitHub <noreply@github.com>2020-03-11 21:15:45 +0100
commitfd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8 (patch)
treeb754b3991e5e57a9ae9155819f73fa0cbd4be269 /cloudinit/cmd/tests/test_clean.py
parentca9a4eb26b41c204d1bd3a15586b14a5dde950bb (diff)
parentc6627bc05a57645e6af8b9a5a67e452d9f37e487 (diff)
downloadvyos-cloud-init-fd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8.tar.gz
vyos-cloud-init-fd87c24ff8f6f09a7e2cc223a4e8cdb8c08f1ef8.zip
Merge pull request #4 from zdc/T2117
Cloud-init: T2117: Updated to 20.1 version
Diffstat (limited to 'cloudinit/cmd/tests/test_clean.py')
-rw-r--r--cloudinit/cmd/tests/test_clean.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cloudinit/cmd/tests/test_clean.py b/cloudinit/cmd/tests/test_clean.py
index 5a3ec3bf..13a69aa1 100644
--- a/cloudinit/cmd/tests/test_clean.py
+++ b/cloudinit/cmd/tests/test_clean.py
@@ -5,7 +5,7 @@ from cloudinit.util import ensure_dir, sym_link, write_file
from cloudinit.tests.helpers import CiTestCase, wrap_and_call, mock
from collections import namedtuple
import os
-from six import StringIO
+from io import StringIO
mypaths = namedtuple('MyPaths', 'cloud_dir')
@@ -22,7 +22,8 @@ class TestClean(CiTestCase):
class FakeInit(object):
cfg = {'def_log_file': self.log1,
'output': {'all': '|tee -a {0}'.format(self.log2)}}
- paths = mypaths(cloud_dir=self.artifact_dir)
+ # Ensure cloud_dir has a trailing slash, to match real behaviour
+ paths = mypaths(cloud_dir='{}/'.format(self.artifact_dir))
def __init__(self, ds_deps):
pass
@@ -136,7 +137,8 @@ class TestClean(CiTestCase):
clean.remove_artifacts, remove_logs=False)
self.assertEqual(1, retcode)
self.assertEqual(
- 'ERROR: Could not remove dir1: oops\n', m_stderr.getvalue())
+ 'ERROR: Could not remove %s/dir1: oops\n' % self.artifact_dir,
+ m_stderr.getvalue())
def test_handle_clean_args_reboots(self):
"""handle_clean_args_reboots when reboot arg is provided."""