Fixing nxos_ntp (#20651)

* Fixing nxos_ntp

* Fixing style issues
pull/22971/merge
Gabriele 7 years ago committed by Nathaniel Case
parent 0e0e5097a9
commit 78ed0cadea

@ -180,11 +180,15 @@ def get_ntp_source(module):
def get_ntp_peer(module):
command = 'show run | inc ntp.(server|peer)'
ntp_peer_list = []
ntp = execute_show_command(
response = execute_show_command(
command, module, command_type='cli_show_ascii')
if ntp:
ntp = ntp[0]
if response:
if isinstance(response, list):
ntp = response[0]
else:
ntp = response
if ntp:
ntp_regex = (
".*ntp\s(server\s(?P<address>\S+)|peer\s(?P<peer_address>\S+))"
"\s*((?P<prefer>prefer)\s*)?(use-vrf\s(?P<vrf_name>\S+)\s*)?"
@ -424,4 +428,3 @@ def main():
from ansible.module_utils.basic import *
if __name__ == '__main__':
main()

Loading…
Cancel
Save