def run(self, cmd, timeout=None, comments=True): if self.remote_ip == None: # (ret, output) = commands.getstatusoutput(cmd, timeout) ret, output = LocalSH.local_run(cmd, timeout, comments) else: ret, output = RemoteSH.remote_run(cmd, self.remote_ip, self.username, self.password, timeout) # ret, output = RemoteSH.run_pexpect(cmd, self.remote_ip, self.username, self.password, timeout) return ret, output
def git_run(self, git_cmd, git_dir=""): # can also pip install gitpython and use it ret, output = LocalSH.run_git(git_cmd, git_dir) return ret, output
def interact_run(self, cmd): ret, output = LocalSH.run_pexpect(cmd) return ret, output
def run(self, cmd, timeout=None, comments=True): if self.remote_ip == None: ret, output = LocalSH.local_run(cmd, timeout, comments) else: ret, output = RemoteSH.remote_run(cmd, self.remote_ip, self.username, self.password, timeout, comments) return ret, output
def runcmd_local_pexpect(cmd, password=""): return LocalSH.run_pexpect(cmd, password)
def runcmd_local(cmd, timeout=None, showlogger=True): return LocalSH.local_run(cmd, timeout, showlogger)
def runcmd(self, cmd): ret, output = LocalSH.local_run(cmd) return ret, output