aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python
diff options
context:
space:
mode:
authorMatej Klotton <mklotton@cisco.com>2017-02-16 08:18:00 +0100
committerMatej Klotton <mklotton@cisco.com>2017-02-16 09:42:13 +0100
commitbb556a4165bba435f21f8f4745b5c64cc277d9dc (patch)
treea5d8f63c1ef4fc6fdf3597d9d01375da10559867 /resources/libraries/python
parent4d9b95cde48fe1b9abf70a5c7c2edcdb3199776d (diff)
Fix ssh prompts for centos
Change-Id: I864f97b4559fc1d692bfba80266150a3d06dd6bb Signed-off-by: Matej Klotton <mklotton@cisco.com>
Diffstat (limited to 'resources/libraries/python')
-rw-r--r--resources/libraries/python/VatExecutor.py4
-rw-r--r--resources/libraries/python/ssh.py6
2 files changed, 6 insertions, 4 deletions
diff --git a/resources/libraries/python/VatExecutor.py b/resources/libraries/python/VatExecutor.py
index 5f7e188b7f..9db53d3a36 100644
--- a/resources/libraries/python/VatExecutor.py
+++ b/resources/libraries/python/VatExecutor.py
@@ -157,8 +157,8 @@ class VatTerminal(object):
"""
- __VAT_PROMPT = "vat# "
- __LINUX_PROMPT = ":~$ "
+ __VAT_PROMPT = ("vat# ", )
+ __LINUX_PROMPT = (":~$ ", "~]$ ")
def __init__(self, node, json_param=True):
json_text = ' json' if json_param else ''
diff --git a/resources/libraries/python/ssh.py b/resources/libraries/python/ssh.py
index 3a2c1b661a..7b15998be0 100644
--- a/resources/libraries/python/ssh.py
+++ b/resources/libraries/python/ssh.py
@@ -220,7 +220,7 @@ class SSH(object):
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:
@@ -265,7 +265,9 @@ class SSH(object):
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):