Fixes for broken asa_config module (#27218)

* Fixes for broken asa_config module

* strip() prompt before checking
This commit is contained in:
Patrick Ogenstad
2017-08-11 17:42:42 +02:00
committed by Peter Sprygada
parent 40eb349ac6
commit 089226e372
5 changed files with 136 additions and 50 deletions

View File

@@ -103,9 +103,10 @@ def to_commands(module, commands):
def run_commands(module, commands, check_rc=True):
commands = to_commands(module, to_list(commands))
connection = get_connection(module)
commands = to_commands(module, to_list(commands))
responses = list()
for cmd in commands:
@@ -116,9 +117,13 @@ def run_commands(module, commands, check_rc=True):
def get_config(module, flags=[]):
cmd = 'show running-config '
cmd += ' '.join(flags)
cmd = cmd.strip()
passwords = module.params['passwords']
if passwords:
cmd = 'more system:running-config'
else:
cmd = 'show running-config '
cmd += ' '.join(flags)
cmd = cmd.strip()
try:
return _DEVICE_CONFIGS[cmd]