summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrahushen <rahul.shenoy.86@gmail.com>2017-09-14 18:29:53 +0200
committerNathaniel Case <this.is@nathanielca.se>2017-09-14 18:29:53 +0200
commit37f68bffc06842e91347a8db08990e5a08727fc0 (patch)
tree0f46164374fef8741ba59119f78b53618ea7693a
parentadd possibility for log messages via log_prefix (#30358) (diff)
downloadansible-37f68bffc06842e91347a8db08990e5a08727fc0.tar.xz
ansible-37f68bffc06842e91347a8db08990e5a08727fc0.zip
fixes #27177 - nxos_aaa_server_host multiple issues (#29103)
-rw-r--r--lib/ansible/modules/network/nxos/nxos_aaa_server_host.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py b/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py
index c575e31e27..03dd134c6e 100644
--- a/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py
+++ b/lib/ansible/modules/network/nxos/nxos_aaa_server_host.py
@@ -167,7 +167,7 @@ def execute_show_command(command, module, command_type='cli_show'):
cmds = [command]
body = run_commands(module, cmds)
elif module.params['transport'] == 'nxapi':
- cmds = [command]
+ cmds = {'command': command, 'output': 'text'}
body = run_commands(module, cmds)
return body
@@ -208,7 +208,7 @@ def get_aaa_host_info(module, server_type, address):
body = execute_show_command(command, module, command_type='cli_show_ascii')
- if body:
+ if body[0]:
try:
pattern = ('(acct-port \d+)|(timeout \d+)|(auth-port \d+)|'
'(key 7 "\w+")|( port \d+)')
@@ -217,9 +217,8 @@ def get_aaa_host_info(module, server_type, address):
'auth-port': 'auth_port',
'port': 'tacacs_port',
'timeout': 'host_timeout'})
- if aaa_host_info:
- aaa_host_info['server_type'] = server_type
- aaa_host_info['address'] = address
+ aaa_host_info['server_type'] = server_type
+ aaa_host_info['address'] = address
except TypeError:
return {}
else: