updates to check_cmd to just return output, as status is pointless
This commit is contained in:
parent
43554cbb62
commit
a8ee7f35d6
12 changed files with 45 additions and 51 deletions
|
@ -96,14 +96,14 @@ class PhysicalNode(PyCoreNode):
|
|||
Runs shell command on node.
|
||||
|
||||
:param list[str]|str args: command to run
|
||||
:return: exist status and combined stdout and stderr
|
||||
:rtype: tuple[int, str]
|
||||
:return: combined stdout and stderr
|
||||
:rtype: str
|
||||
:raises subprocess.CalledProcessError: when a non-zero exit status occurs
|
||||
"""
|
||||
status, output = self.cmd_output(args)
|
||||
if status:
|
||||
raise subprocess.CalledProcessError(status, args, output)
|
||||
return status, output.strip()
|
||||
return output.strip()
|
||||
|
||||
def shcmd(self, cmdstr, sh="/bin/sh"):
|
||||
return self.cmd([sh, "-c", cmdstr])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue