aboutsummaryrefslogtreecommitdiff
path: root/lava_dispatcher/shell.py
diff options
context:
space:
mode:
authorNeil Williams <neil.williams@linaro.org>2018-03-21 09:59:30 +0000
committerMatt Hart <matthew.hart@linaro.org>2018-03-28 17:10:19 +0000
commitbb910afd6e7da82670e3f345dd012044c0f76f42 (patch)
tree1c8e17208ae8794f8fa1813954679f47a828f14f /lava_dispatcher/shell.py
parent8d6c5ec70dee2f899e83d681efff033f83e36899 (diff)
Fixup connection.prompt_str assumption
The complex string / list handling of the connection prompts is a pexpect behaviour. Clarify our code handling to avoid TypeError when adding a list to an existing prompt string by first converting to a list with a single string entry. Change-Id: I570f2ad51b436a4a7bfcac1e642bb2533b788f16
Diffstat (limited to 'lava_dispatcher/shell.py')
-rw-r--r--lava_dispatcher/shell.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lava_dispatcher/shell.py b/lava_dispatcher/shell.py
index f85d52650..8766f6fd4 100644
--- a/lava_dispatcher/shell.py
+++ b/lava_dispatcher/shell.py
@@ -201,6 +201,12 @@ class ShellSession(Connection):
@prompt_str.setter
def prompt_str(self, string):
+ """
+ pexpect allows the prompt to be a single string or a list of strings
+ this property simply replaces the previous value with the new one
+ whether that is a string or a list of strings.
+ To use + the instance of the existing prompt_str must be checked.
+ """
# FIXME: Debug logging should show whenever this property is changed
self.__prompt_str__ = string