From 97858d91ac8e84963496ae2a8c3724ceef8bf295 Mon Sep 17 00:00:00 2001 From: Ganesh Nalawade Date: Thu, 28 Sep 2017 18:07:37 +0530 Subject: [PATCH] Add alias to command option in telnet (#30825) * Add commands alias to telnet option --- lib/ansible/modules/commands/telnet.py | 1 + lib/ansible/plugins/action/telnet.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/commands/telnet.py b/lib/ansible/modules/commands/telnet.py index 65842233faa..17530aa88d1 100644 --- a/lib/ansible/modules/commands/telnet.py +++ b/lib/ansible/modules/commands/telnet.py @@ -22,6 +22,7 @@ options: description: - List of commands to be executed in the telnet session. required: True + aliases: ['commands'] host: description: - The host/target on which to execute the command diff --git a/lib/ansible/plugins/action/telnet.py b/lib/ansible/plugins/action/telnet.py index de89339b9ee..eb3883a3df4 100644 --- a/lib/ansible/plugins/action/telnet.py +++ b/lib/ansible/plugins/action/telnet.py @@ -43,7 +43,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', "$ ") - commands = self._task.args.get('command') + commands = self._task.args.get('command') or self._task.args.get('commands') if isinstance(commands, text_type): commands = commands.split(',')