From: Tom Hromatka Date: Mon, 7 Oct 2019 20:44:46 +0000 (-0600) Subject: tests: Fix inconsistent return value in functional test's Container() class X-Git-Tag: v0.42.rc1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=320eef9a5d0b213f1a8d6d30f563a962f914acd8;p=thirdparty%2Flibcgroup.git 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 --- 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()