Exemplo n.º 1
0
    def __init__(self,
                 host,
                 username,
                 password,
                 port=None,
                 on_session_start=None,
                 pkey=None,
                 *args,
                 **kwargs):
        ConnectionParams.__init__(self,
                                  host,
                                  port=port,
                                  on_session_start=on_session_start,
                                  pkey=pkey)
        ExpectSession.__init__(self, *args, **kwargs)

        if hasattr(self, 'port') and self.port is None:
            self.port = 22

        self.username = username
        self.password = password
        self.pkey = pkey

        self._handler = None
        self._current_channel = None
        self._buffer_size = self.BUFFER_SIZE
Exemplo n.º 2
0
    def __init__(self, host, port, on_session_start=None, *args, **kwargs):
        ConnectionParams.__init__(
            self, host=host, port=port, on_session_start=on_session_start
        )
        ExpectSession.__init__(self, *args, **kwargs)

        self._buffer_size = self.BUFFER_SIZE
        self._handler = None
    def __eq__(self, other):
        """Is equal.

        :type other: TelnetSession
        """
        return (ConnectionParams.__eq__(self, other)
                and self.username == other.username
                and self.password == other.password)
Exemplo n.º 4
0
 def __eq__(self, other):
     """
     :param other:
     :type other: TelnetSession
     :return:
     """
     return ConnectionParams.__eq__(
         self, other
     ) and self.username == other.username and self.password == other.password
Exemplo n.º 5
0
    def __eq__(self, other):
        """Is equal.

        :param SSHSession other:
        """
        return all([
            ConnectionParams.__eq__(self, other),
            self.username == other.username,
            self.password == other.password,
            self.pkey == other.pkey,
        ])
Exemplo n.º 6
0
    def __init__(self,
                 host,
                 username,
                 password,
                 port=None,
                 on_session_start=None,
                 *args,
                 **kwargs):
        ConnectionParams.__init__(self,
                                  host,
                                  port=port,
                                  on_session_start=on_session_start)
        ExpectSession.__init__(self, *args, **kwargs)

        if hasattr(self, 'port') and self.port is None:
            self.port = 23

        self.username = username
        self.password = password

        self._handler = None