mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
updates network_common lib (#21306)
* removes connection functions refactored into connection * updates ComplexDict and ComplexList objects to use with AnsibleModule * updates modules to add new argument to ComplexList & ComplexDict
This commit is contained in:
parent
009ac075b7
commit
b0c01bbb82
7 changed files with 111 additions and 103 deletions
|
@ -143,13 +143,14 @@ def to_lines(stdout):
|
|||
return lines
|
||||
|
||||
def parse_commands(module, warnings):
|
||||
transform = ComplexList(dict(
|
||||
spec = dict(
|
||||
command=dict(key=True),
|
||||
output=dict(),
|
||||
prompt=dict(),
|
||||
response=dict()
|
||||
))
|
||||
)
|
||||
|
||||
transform = ComplexList(spec, module)
|
||||
commands = transform(module.params['commands'])
|
||||
|
||||
for index, item in enumerate(commands):
|
||||
|
|
|
@ -272,12 +272,12 @@ def map_params_to_obj(module):
|
|||
lookup_source = ComplexList(dict(
|
||||
interface=dict(key=True),
|
||||
vrf=dict()
|
||||
))
|
||||
), module)
|
||||
|
||||
name_servers = ComplexList(dict(
|
||||
server=dict(key=True),
|
||||
vrf=dict(default='default')
|
||||
))
|
||||
), module)
|
||||
|
||||
for arg, cast in [('lookup_source', lookup_source), ('name_servers', name_servers)]:
|
||||
if module.params[arg] is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue