updated commands that return output to strip it before returning

This commit is contained in:
Blake J. Harnden 2018-03-01 13:46:09 -08:00
parent d3bd61ddcf
commit 870d87804b
2 changed files with 4 additions and 4 deletions

View file

@ -101,7 +101,7 @@ class VnodeClient(object):
stdout.close() stdout.close()
stderr.close() stderr.close()
status = p.wait() status = p.wait()
return status, output return status, output.strip()
def check_cmd(self, cmd): def check_cmd(self, cmd):
""" """
@ -115,7 +115,7 @@ class VnodeClient(object):
status, output = self.cmd_output(cmd) status, output = self.cmd_output(cmd)
if status: if status:
raise subprocess.CalledProcessError(status, cmd, output) raise subprocess.CalledProcessError(status, cmd, output)
return status, output return status, output.strip()
def popen(self, cmd): def popen(self, cmd):
""" """

View file

@ -90,7 +90,7 @@ class PhysicalNode(PyCoreNode):
# err will always be None # err will always be None
stdout, err = p.communicate() stdout, err = p.communicate()
status = p.wait() status = p.wait()
return status, stdout return status, stdout.strip()
def check_cmd(self, cmd): def check_cmd(self, cmd):
""" """
@ -104,7 +104,7 @@ class PhysicalNode(PyCoreNode):
status, output = self.cmd_output(cmd) status, output = self.cmd_output(cmd)
if status: if status:
raise subprocess.CalledProcessError(status, cmd, output) raise subprocess.CalledProcessError(status, cmd, output)
return status, output return status, output.strip()
def shcmd(self, cmdstr, sh="/bin/sh"): def shcmd(self, cmdstr, sh="/bin/sh"):
return self.cmd([sh, "-c", cmdstr]) return self.cmd([sh, "-c", cmdstr])