From 780dc9c561c8f8342a0298955ec5f6fabfcf67c0 Mon Sep 17 00:00:00 2001 From: Nathaniel Case Date: Mon, 17 Sep 2018 08:42:20 -0400 Subject: [PATCH] There are other instances of transform being used... update them as well (#45663) --- lib/ansible/module_utils/network/eos/eos.py | 6 ++++-- lib/ansible/module_utils/network/ios/ios.py | 14 ++------------ lib/ansible/module_utils/network/nxos/nxos.py | 6 ++++-- lib/ansible/modules/network/eos/eos_command.py | 3 +-- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/lib/ansible/module_utils/network/eos/eos.py b/lib/ansible/module_utils/network/eos/eos.py index 882bd45ce1..7c9296b907 100644 --- a/lib/ansible/module_utils/network/eos/eos.py +++ b/lib/ansible/module_utils/network/eos/eos.py @@ -413,8 +413,10 @@ def to_command(module, commands): transform = ComplexList(dict( command=dict(key=True), output=dict(default=default_output), - prompt=dict(), - answer=dict() + prompt=dict(type='list'), + answer=dict(type='list'), + sendonly=dict(type='bool', default=False), + check_all=dict(type='bool', default=False), ), module) return transform(to_list(commands)) diff --git a/lib/ansible/module_utils/network/ios/ios.py b/lib/ansible/module_utils/network/ios/ios.py index ac79357033..c2a7c3d4b6 100644 --- a/lib/ansible/module_utils/network/ios/ios.py +++ b/lib/ansible/module_utils/network/ios/ios.py @@ -28,8 +28,8 @@ import json from ansible.module_utils._text import to_text -from ansible.module_utils.basic import env_fallback, return_values -from ansible.module_utils.network.common.utils import to_list, ComplexList +from ansible.module_utils.basic import env_fallback +from ansible.module_utils.network.common.utils import to_list from ansible.module_utils.connection import Connection, ConnectionError _DEVICE_CONFIGS = {} @@ -119,16 +119,6 @@ def get_config(module, flags=None): return cfg -def to_commands(module, commands): - spec = { - 'command': dict(key=True), - 'prompt': dict(), - 'answer': dict() - } - transform = ComplexList(spec, module) - return transform(commands) - - def run_commands(module, commands, check_rc=True): connection = get_connection(module) try: diff --git a/lib/ansible/module_utils/network/nxos/nxos.py b/lib/ansible/module_utils/network/nxos/nxos.py index 8ca12f10f1..d20211982d 100644 --- a/lib/ansible/module_utils/network/nxos/nxos.py +++ b/lib/ansible/module_utils/network/nxos/nxos.py @@ -488,8 +488,10 @@ def to_command(module, commands): transform = ComplexList(dict( command=dict(key=True), output=dict(default=default_output), - prompt=dict(), - answer=dict() + prompt=dict(type='list'), + answer=dict(type='list'), + sendonly=dict(type='bool', default=False), + check_all=dict(type='bool', default=False), ), module) commands = transform(to_list(commands)) diff --git a/lib/ansible/modules/network/eos/eos_command.py b/lib/ansible/modules/network/eos/eos_command.py index edca722f5c..d290858483 100644 --- a/lib/ansible/modules/network/eos/eos_command.py +++ b/lib/ansible/modules/network/eos/eos_command.py @@ -158,7 +158,7 @@ from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.common.parsing import Conditional from ansible.module_utils.network.common.utils import transform_commands, to_lines from ansible.module_utils.network.eos.eos import run_commands -from ansible.module_utils.network.eos.eos import eos_argument_spec, check_args +from ansible.module_utils.network.eos.eos import eos_argument_spec VALID_KEYS = ['command', 'output', 'prompt', 'response'] @@ -205,7 +205,6 @@ def main(): warnings = list() result = {'changed': False, 'warnings': warnings} - check_args(module, warnings) commands = parse_commands(module, warnings) wait_for = module.params['wait_for'] or list()