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 <tom.hroma...@oracle.com>
---
 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 a078597..6d4a100 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()
-- 
1.8.3.1



_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to