Example #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)
Example #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
Example #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
Example #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)