fix for nxos_ospf_vrf invalid cmd and ntp errors (#27977)

* fix for nxos_ospf_vrf invalid cmd

* fix for nxos_ntp issues
This commit is contained in:
saichint 2017-08-14 13:09:16 -07:00 committed by Nathaniel Case
commit 9d84a4e530
20 changed files with 271 additions and 13 deletions

View file

@ -135,16 +135,16 @@ import re
def execute_show_command(command, module, command_type='cli_show'):
if module.params['transport'] == 'cli':
if 'show run' not in command:
command += ' | json'
cmds = [command]
body = run_commands(module, cmds)
elif module.params['transport'] == 'nxapi':
cmds = [command]
body = run_commands(module, cmds)
if 'show run' not in command:
output = 'json'
else:
output = 'text'
return body
commands = [{
'command': command,
'output': output,
}]
return run_commands(module, commands)
def flatten_list(command_lists):
@ -170,7 +170,7 @@ def get_ntp_source(module):
else:
source_type = 'source'
source = output[0].split()[2].lower()
except AttributeError:
except (AttributeError, IndexError):
source_type = None
source = None
@ -327,7 +327,6 @@ def main():
warnings = list()
check_args(module, warnings)
server = module.params['server'] or None
peer = module.params['peer'] or None
key_id = module.params['key_id']

View file

@ -146,7 +146,6 @@ from ansible.module_utils.netcfg import CustomNetworkConfig
PARAM_TO_COMMAND_KEYMAP = {
'vrf': 'vrf',
'ospf': 'ospf',
'router_id': 'router-id',
'default_metric': 'default-metric',
'log_adjacency': 'log-adjacency-changes',