mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
minor clean up of junos_command (#22545)
* removes unneeded check_transport function * removes unneeded global vars * verifies all integration tests are passing
This commit is contained in:
parent
995497129e
commit
09c08e1939
1 changed files with 0 additions and 18 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue