renamed utils.check_cmd to utils.cmd, updated host_cmd to allow for shell commands for output redirection

This commit is contained in:
Blake Harnden 2019-10-21 10:32:42 -07:00
parent 16b7e70c33
commit 78f981463d
15 changed files with 34 additions and 31 deletions

View file

@ -79,7 +79,7 @@ class NodeBase(object):
"""
raise NotImplementedError
def host_cmd(self, args, env=None, cwd=None, wait=True):
def host_cmd(self, args, env=None, cwd=None, wait=True, shell=False):
"""
Runs a command on the host system or distributed server.
@ -87,12 +87,13 @@ class NodeBase(object):
:param dict env: environment to run command with
:param str cwd: directory to run command in
:param bool wait: True to wait for status, False otherwise
:param bool shell: True to use shell, False otherwise
:return: combined stdout and stderr
:rtype: str
:raises CoreCommandError: when a non-zero exit status occurs
"""
if self.server is None:
return utils.check_cmd(args, env, cwd, wait)
return utils.cmd(args, env, cwd, wait, shell)
else:
return self.server.remote_cmd(args, env, cwd, wait)