Exemplo n.º 1
0
 def _run_ssh_cmd(self, host, cmd):
     """Open SSH session with host and execute command."""
     try:
         sshclient = SSHClient(host, self.usr, self.pwd,
                               key_filename=self.key, timeout=self.timeout)
         return sshclient.exec_longrun_command(cmd)
     except Exception:
         LOG.debug(traceback.format_exc())
         self.fail("%s command failed." % cmd)
Exemplo n.º 2
0
 def _run_ssh_cmd(self, host, cmd):
     """Open SSH session with host and and execute command."""
     try:
         sshclient = SSHClient(host, self.usr, self.pwd,
                               key_filename=self.key, timeout=self.timeout)
         return sshclient.exec_longrun_command(cmd)
     except Exception:
         LOG.debug(traceback.format_exc())
         self.fail("%s command failed." % cmd)
Exemplo n.º 3
0
    def _run_ssh_cmd(self, cmd):
        """Open SSH session with Controller and and execute command."""
        if not self.host:
            self.fail('Wrong test configuration: '
                      '"online_controllers" parameter is empty.')

        try:
            sshclient = SSHClient(self.host[0], self.usr, self.pwd,
                                  key_filename=self.key, timeout=self.timeout)
            return sshclient.exec_longrun_command(cmd)
        except Exception:
            LOG.debug(traceback.format_exc())
            self.fail("%s command failed." % cmd)
Exemplo n.º 4
0
    def _run_ssh_cmd(self, cmd):
        """
        Open SSH session with Controller and and execute command.
        """
        if not self.host:
            self.fail('Wrong test configuration: '
                      '"online_controllers" parameter is empty.')

        try:
            sshclient = SSHClient(self.host[0],
                                  self.usr,
                                  self.pwd,
                                  key_filename=self.key,
                                  timeout=self.timeout)
            return sshclient.exec_longrun_command(cmd)
        except Exception:
            LOG.debug(traceback.format_exc())
            self.fail("%s command failed." % cmd)