I found a couple minor issues when running the tests on Travis CI. The RunError() exception wasn't being invoked properly and there was a typo in its string generation. This commit resolves both of these issues
Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com> --- tests/ftests/container.py | 4 ++-- tests/ftests/run.py | 7 ++++--- 2 files changed, 6 insertions(+), 5 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() diff --git a/tests/ftests/run.py b/tests/ftests/run.py index 80e5221..0b4e068 100644 --- a/tests/ftests/run.py +++ b/tests/ftests/run.py @@ -54,8 +54,8 @@ class Run(object): ''.join(command), ret, out, err)) if ret != 0: - raise RunError("Command '{}' failed".format(''.join(command), - command, ret, out, err)) + raise RunError("Command '{}' failed".format(''.join(command)), + command, ret, out, err) return out @@ -69,6 +69,7 @@ class RunError(Exception): self.stderr = stderr def __str__(self): - out_str = "RunError:\n\tmessage = {}\n\tret = {}".format(self.message, self.ret) + out_str = "RunError:\n\tcommand = {}\n\tret = {}".format( + self.command, self.ret) out_str += "\n\tstdout = {}\n\tstderr = {}".format(self.stdout, self.stderr) return out_str -- 2.21.0 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel