From 09c08e193951826ff9c0c27ea5668c4557b7eb2e Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Sun, 12 Mar 2017 10:06:53 -0500 Subject: [PATCH] minor clean up of junos_command (#22545) * removes unneeded check_transport function * removes unneeded global vars * verifies all integration tests are passing --- .../modules/network/junos/junos_command.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lib/ansible/modules/network/junos/junos_command.py b/lib/ansible/modules/network/junos/junos_command.py index 2a33255115..1e6099c40c 100644 --- a/lib/ansible/modules/network/junos/junos_command.py +++ b/lib/ansible/modules/network/junos/junos_command.py @@ -144,7 +144,6 @@ from functools import partial from xml.etree import ElementTree as etree from xml.etree.ElementTree import Element, SubElement, tostring - from ansible.module_utils.junos import junos_argument_spec, check_args from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.netcli import Conditional, FailedConditionalError @@ -160,21 +159,6 @@ except ImportError: USE_PERSISTENT_CONNECTION = True - -VALID_KEYS = { - 'cli': frozenset(['command', 'output', 'prompt', 'response']), - 'rpc': frozenset(['command', 'output']) -} - -def check_transport(module): - transport = (module.params['provider'] or {}).get('transport') - - if transport == 'netconf' and not module.params['rpcs']: - module.fail_json(msg='argument commands is only supported over cli transport') - - elif transport == 'cli' and not module.params['commands']: - module.fail_json(msg='argument rpcs is only supported over netconf transport') - def to_lines(stdout): lines = list() for item in stdout: @@ -314,8 +298,6 @@ def main(): required_one_of=required_one_of, supports_check_mode=True) - check_transport(module) - warnings = list() check_args(module, warnings)