From 320eef9a5d0b213f1a8d6d30f563a962f914acd8 Mon Sep 17 00:00:00 2001 From: Tom Hromatka Date: Mon, 7 Oct 2019 14:44:46 -0600 Subject: [PATCH] tests: Fix inconsistent return value in functional test's Container() class This commit fixes the Container() class' inconsistent usage of decode(). In the rootfs() method, it returned a binary array in one case and a string in another. Now the rootfs() method will always return a string. Signed-off-by: Tom Hromatka Signed-off-by: Dhaval Giani --- tests/ftests/container.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ftests/container.py b/tests/ftests/container.py index a078597b..6d4a1007 100644 --- a/tests/ftests/container.py +++ b/tests/ftests/container.py @@ -154,14 +154,14 @@ class Container(object): # try to read lxc.rootfs.path first ret = self.info('lxc.rootfs.path') if len(ret.strip()) > 0: - return ret + return ret.decode() # older versions of lxc used lxc.rootfs. Try that. ret = self.info('lxc.rootfs') if len(ret.strip()) == 0: # we failed to get the rootfs raise ContainerError('Failed to get the rootfs') - return ret.decode('ascii') + return ret.decode() def run(self, cntnr_cmd): cmd = list() -- 2.47.2