diff options
author | Gabriele <gabrielegerbino@gmail.com> | 2016-09-30 16:20:23 -0400 |
---|---|---|
committer | Peter Sprygada <privateip@users.noreply.github.com> | 2016-09-30 16:20:23 -0400 |
commit | 11f628a1242634eaa5061bfac81f0cecc938bf43 (patch) | |
tree | 61c1ee64d9124e38ee50b88f6e214cae2ab3c516 /network/nxos | |
parent | 099aa0d82d12515cfd9c2c8cb96dcedec785d56e (diff) | |
download | ansible-modules-core-11f628a1242634eaa5061bfac81f0cecc938bf43.tar.gz |
Fixing nxos_snmp_community (#5022)
Diffstat (limited to 'network/nxos')
-rw-r--r-- | network/nxos/nxos_snmp_community.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/network/nxos/nxos_snmp_community.py b/network/nxos/nxos_snmp_community.py index 137dd771..5abc428f 100644 --- a/network/nxos/nxos_snmp_community.py +++ b/network/nxos/nxos_snmp_community.py @@ -283,10 +283,7 @@ def get_cli_body_ssh(command, response, module): body = response else: try: - if isinstance(response[0], str): - body = [json.loads(response[0])] - else: - body = response + body = [json.loads(response[0])] except ValueError: module.fail_json(msg='Command does not support JSON output', command=command) @@ -315,7 +312,7 @@ def execute_show(cmds, module, command_type=None): module.cli.add_commands(cmds, output=command_type) response = module.cli.run_commands() else: - module.cli.add_commands(cmds) + module.cli.add_commands(cmds, raw=True) response = module.cli.run_commands() except ShellError: clie = get_exception() @@ -485,6 +482,8 @@ def main(): changed = True execute_config_command(cmds, module) end_state = get_snmp_community(module, community) + if 'configure' in cmds: + cmds.pop(0) results = {} results['proposed'] = proposed |