def enter_cli_mode(self):
        """Check if at shell prompt root@ and go into CLI."""
        delay_factor = self.select_delay_factor(delay_factor=0)
        count = 0
        cur_prompt = ""
        while count < 50:
            self.write_channel(self.RETURN)
            time.sleep(0.1 * delay_factor)
            cur_prompt = self.read_channel()
            if re.search(r"root@", cur_prompt) or re.search(r"^%$", cur_prompt.strip()):
                self.write_channel("cli" + self.RETURN)
                time.sleep(0.3 * delay_factor)
                self.clear_buffer()
                break
            elif ">" in cur_prompt or "#" in cur_prompt:
                break
            count += 1
def enter_cli_mode ( self ) : delay_factor = self . select_delay_factor ( delay_factor = 0 ) count = 0 cur_prompt = "" while count < 50 : self . write_channel ( self . RETURN ) time . sleep ( 0.1 * delay_factor ) cur_prompt = self . read_channel ( ) if re . search ( r"root@" , cur_prompt ) or re . search ( r"^%$" , cur_prompt . strip ( ) ) : self . write_channel ( "cli" + self . RETURN ) time . sleep ( 0.3 * delay_factor ) self . clear_buffer ( ) break elif ">" in cur_prompt or "#" in cur_prompt : break count += 1
Check if at shell prompt root@ and go into CLI.