removed node based check_cmd, updated to use appropriate function

This commit is contained in:
Blake Harnden 2019-10-11 12:57:37 -07:00
parent 4a6d69bb09
commit d326f246a7
11 changed files with 51 additions and 113 deletions

View file

@ -48,12 +48,23 @@ class CoreInterface(object):
self.server = server
self.net_client = LinuxNetClient(self.net_cmd)
def net_cmd(self, args):
def net_cmd(self, args, env=None, cwd=None, wait=True):
"""
Runs a command on the host system or distributed servers.
:param list[str]|str args: command to run
: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
: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)
return utils.check_cmd(args, env=env, cwd=cwd)
else:
args = " ".join(args)
return distributed.remote_cmd(self.server, args)
return distributed.remote_cmd(self.server, args, env, cwd, wait)
def startup(self):
"""