From 9180d2c7f2cb51672ab3ccd081761b83fcc994df Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Mon, 22 Oct 2018 12:59:10 -0500 Subject: [PATCH] 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. --- lib/ansible/plugins/action/telnet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/action/telnet.py b/lib/ansible/plugins/action/telnet.py index 201f3bb0380..63b3870c34e 100644 --- a/lib/ansible/plugins/action/telnet.py +++ b/lib/ansible/plugins/action/telnet.py @@ -51,7 +51,7 @@ class ActionModule(ActionBase): login_prompt = self._task.args.get('login_prompt', "login: ") 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') if isinstance(commands, text_type):