Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 def interact_run(self, cmd):
     ret, output = LocalSH.run_pexpect(cmd)
     return ret, output
Exemplo n.º 5
0
 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
Exemplo n.º 6
0
 def interact_run(self, cmd):
     ret, output = LocalSH.run_pexpect(cmd)
     return ret, output
Exemplo n.º 7
0
 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
Exemplo n.º 8
0
def runcmd_local_pexpect(cmd, password=""):
    return LocalSH.run_pexpect(cmd, password)
Exemplo n.º 9
0
def runcmd_local(cmd, timeout=None, showlogger=True):
    return LocalSH.local_run(cmd, timeout, showlogger)
Exemplo n.º 10
0
 def runcmd(self, cmd):
     ret, output = LocalSH.local_run(cmd)
     return ret, output