mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
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:
parent
19a6000d97
commit
9d84a4e530
20 changed files with 271 additions and 13 deletions
|
@ -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']
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue