fixs command dict to be sent to connection socket ()

There as an invalid key in the command dict that would cause failure
using prompts.  This changes the key from response to answer which is
what is expected by network_cli
This commit is contained in:
Peter Sprygada 2017-02-22 09:44:04 -05:00 committed by GitHub
parent 6e7b89764e
commit 9e6980a039
9 changed files with 7 additions and 11 deletions

View file

@ -332,7 +332,7 @@ def to_command(module, commands):
command=dict(key=True),
output=dict(default=default_output),
prompt=dict(),
response=dict()
answer=dict()
), module)
commands = transform(to_list(commands))

View file

@ -259,7 +259,7 @@ class CliBase(object):
transform = ComplexDict(dict(
command=dict(key=True),
prompt=dict(),
response=dict(),
answer=dict(),
sendonly=dict(default=False)
))
return transform(obj)

View file

@ -147,7 +147,7 @@ def parse_commands(module, warnings):
command=dict(key=True),
output=dict(),
prompt=dict(),
response=dict()
answer=dict()
)
transform = ComplexList(spec, module)

View file

@ -111,9 +111,7 @@ updates:
from ansible.module_utils.ios import load_config, get_config
from ansible.module_utils.ios import ios_argument_spec, check_args
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network_common import ComplexList
from ansible.module_utils.netcli import Conditional
from ansible.module_utils.six import string_types
from ansible.module_utils.netcfg import NetworkConfig, dumps
def get_current_config(module):

View file

@ -148,7 +148,7 @@ def parse_commands(module, warnings):
command = ComplexList(dict(
command=dict(key=True),
prompt=dict(),
response=dict()
answer=dict()
), module)
commands = command(module.params['commands'])
for index, item in enumerate(commands):

View file

@ -209,9 +209,7 @@ from ansible.module_utils.ios import run_commands, get_config, load_config
from ansible.module_utils.ios import ios_argument_spec
from ansible.module_utils.ios import check_args as ios_check_args
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.network_common import ComplexList
from ansible.module_utils.netcli import Conditional
from ansible.module_utils.six import string_types
from ansible.module_utils.netcfg import NetworkConfig, dumps
from ansible.module_utils.six import iteritems

View file

@ -146,7 +146,7 @@ def parse_commands(module, warnings):
command = ComplexList(dict(
command=dict(key=True),
prompt=dict(),
response=dict()
answer=dict()
), module)
commands = command(module.params['commands'])

View file

@ -178,7 +178,7 @@ def parse_commands(module, warnings):
command=dict(key=True),
output=dict(),
prompt=dict(),
response=dict()
answer=dict()
), module)
commands = transform(module.params['commands'])

View file

@ -151,7 +151,7 @@ def parse_commands(module, warnings):
command = ComplexList(dict(
command=dict(key=True),
prompt=dict(),
response=dict(),
answer=dict(),
), module)
commands = command(module.params['commands'])