Exemplo n.º 1
0
 def setup_class(self):
     switchip = str(cfg.get('SANSwitches', 'switch0'))
     ssh_port = cfg.getint('SANSwitcheSetting', 'ssh_port')
     user = str(cfg.get('SANSwitcheSetting', 'username'))
     password = str(cfg.get('SANSwitcheSetting', 'password'))
     timeout = 2
     self.ssh = Conn.SSHConn(switchip, ssh_port, user, password, timeout)
Exemplo n.º 2
0
 def _get_switch_info(self):
     self._SWConn = conn.SSHConn(self._host, self._port, self._username,
                                 self._password, self._timeout)
     if self._SWConn.SSHConnection:
         self.strPorterrshow = self._SWConn.exctCMD('porterrshow')
         time.sleep(0.25)
         self.strSwitchshow = self._SWConn.exctCMD('switchshow')
         return True
     else:
         self.strPorterrshow = None
         self.strSwitchshow = None