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:
Peter Sprygada 2017-02-14 14:38:30 -05:00 committed by GitHub
commit b0c01bbb82
7 changed files with 111 additions and 103 deletions

View file

@ -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):

View file

@ -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: