removing cmd_output function from utils and nodes

This commit is contained in:
Blake Harnden 2019-10-11 09:34:49 -07:00
parent c3d27eb8a5
commit 4a6d69bb09
10 changed files with 51 additions and 193 deletions

View file

@ -207,27 +207,6 @@ def mute_detach(args, **kwargs):
return subprocess.Popen(args, **kwargs).pid
def cmd_output(args):
"""
Execute a command on the host and return a tuple containing the exit status and
result string. stderr output is folded into the stdout result string.
:param list[str]|str args: command arguments
:return: command status and stdout
:rtype: tuple[int, str]
:raises CoreCommandError: when the file to execute is not found
"""
args = split_args(args)
logging.debug("command: %s", args)
try:
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, _ = p.communicate()
status = p.wait()
return status, stdout.decode("utf-8").strip()
except OSError:
raise CoreCommandError(-1, args)
def check_cmd(args, **kwargs):
"""
Execute a command on the host and return a tuple containing the exit status and