escape default prompt detection in telnet action plugin (#46573)

This change fixes an issue with the default prompt handling.  The value
needs to be escaped otherwise it does not work when converted to bytes.
This commit is contained in:
Peter Sprygada 2018-10-22 12:59:10 -05:00 committed by Nathaniel Case
parent 299a5e4af3
commit 9180d2c7f2

View file

@ -51,7 +51,7 @@ class ActionModule(ActionBase):
login_prompt = self._task.args.get('login_prompt', "login: ") login_prompt = self._task.args.get('login_prompt', "login: ")
password_prompt = self._task.args.get('password_prompt', "Password: ") password_prompt = self._task.args.get('password_prompt', "Password: ")
prompts = self._task.args.get('prompts', ["$ "]) prompts = self._task.args.get('prompts', ["\\$ "])
commands = self._task.args.get('command') or self._task.args.get('commands') commands = self._task.args.get('command') or self._task.args.get('commands')
if isinstance(commands, text_type): if isinstance(commands, text_type):