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.hromatka@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
# 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()