From: Zack Cerza Date: Wed, 22 Apr 2015 21:50:27 +0000 (-0600) Subject: Fix CommandFailedError when node is None X-Git-Tag: 1.1.0~946^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6f609b5122cd4b9534808682cc03bc3200ed5b70;p=teuthology.git Fix CommandFailedError when node is None Signed-off-by: Zack Cerza --- diff --git a/teuthology/exceptions.py b/teuthology/exceptions.py index efc8e71f8..9034d5fad 100644 --- a/teuthology/exceptions.py +++ b/teuthology/exceptions.py @@ -42,9 +42,10 @@ class CommandFailedError(Exception): def __str__(self): prefix = "Command failed" if self.label: - prefix = "Command failed ({label})".format(label=self.label) - return "{prefix} on {node} with status {status}: {cmd!r}".format( - node=self.node, + prefix += " ({label})".format(label=self.label) + if self.node: + prefix += " on {node}".format(node=self.node) + return "{prefix} with status {status}: {cmd!r}".format( status=self.exitstatus, cmd=self.command, prefix=prefix,