Change-Id: I864f97b4559fc1d692bfba80266150a3d06dd6bb
Signed-off-by: Matej Klotton <mklotton@cisco.com>
- __VAT_PROMPT = "vat# "
- __LINUX_PROMPT = ":~$ "
+ __VAT_PROMPT = ("vat# ", )
+ __LINUX_PROMPT = (":~$ ", "~]$ ")
def __init__(self, node, json_param=True):
json_text = ' json' if json_param else ''
def __init__(self, node, json_param=True):
json_text = ' json' if json_param else ''
chan.set_combine_stderr(True)
buf = ''
chan.set_combine_stderr(True)
buf = ''
- while not buf.endswith(':~$ '):
+ while not buf.endswith((":~$ ", "~]$ ")):
try:
chunk = chan.recv(self.__MAX_RECV_BUF)
if not chunk:
try:
chunk = chan.recv(self.__MAX_RECV_BUF)
if not chunk:
except socket.timeout:
raise Exception('Socket timeout: {0}'.format(buf))
tmp = buf.replace(cmd.replace('\n', ''), '')
except socket.timeout:
raise Exception('Socket timeout: {0}'.format(buf))
tmp = buf.replace(cmd.replace('\n', ''), '')
- return tmp.replace(prompt, '')
+ for p in prompt:
+ tmp.replace(p, '')
+ return tmp
@staticmethod
def interactive_terminal_close(chan):
@staticmethod
def interactive_terminal_close(chan):