Ejemplo n.º 1
0
    def send_command(self, command, timeout=1):
        try:
            ignore_keyintr()
            self.clean_session()
            self.__sendline(command)
            aware_keyintr()
        except Exception as e:
            raise (e)

        return self.get_session_before(timeout=timeout)
Ejemplo n.º 2
0
    def send_expect_base(self, command, expected, timeout):
        ignore_keyintr()
        self.clean_session()
        self.session.PROMPT = expected
        self.__sendline(command)
        self.__prompt(command, timeout)
        aware_keyintr()

        before = self.get_output_before()
        return before
Ejemplo n.º 3
0
    def get_session_before(self, timeout=15):
        """
        Get all output before timeout
        """
        ignore_keyintr()
        try:
            self.session.prompt(timeout)
        except Exception as e:
            pass

        aware_keyintr()
        before = self.get_output_before()
        self.__flush()
        return before
Ejemplo n.º 4
0
 def send_command(self, command, timeout=1):
     ignore_keyintr()
     self.clean_session()
     self.__sendline(command)
     aware_keyintr()
     return self.get_session_before(timeout)