From 3134ba6bee9e0ede1f388bb6cd6df37053bcefa6 Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Thu, 8 Mar 2018 14:36:32 -0500 Subject: [PATCH] Do not try to add an entry if none exist (#37152) When commit revisions are disabled, there will be no revision items returned. Add note about setting ANSIBLE_PERSISTENT_COMMAND_TIMEOUT to a higer value to avoid timeouts. --- lib/ansible/modules/network/edgeos/edgeos_config.py | 3 +++ lib/ansible/modules/network/edgeos/edgeos_facts.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/edgeos/edgeos_config.py b/lib/ansible/modules/network/edgeos/edgeos_config.py index ae124591f7..6ca11069d6 100644 --- a/lib/ansible/modules/network/edgeos/edgeos_config.py +++ b/lib/ansible/modules/network/edgeos/edgeos_config.py @@ -27,6 +27,9 @@ description: in the device configuration. notes: - Tested against EdgeOS 1.9.7 + - Setting C(ANSIBLE_PERSISTENT_COMMAND_TIMEOUT) to 30 is recommended since + the save command can take longer than the default of 10 seconds on + some EdgeOS hardware. options: lines: description: diff --git a/lib/ansible/modules/network/edgeos/edgeos_facts.py b/lib/ansible/modules/network/edgeos/edgeos_facts.py index a22b4ac375..d003854f56 100644 --- a/lib/ansible/modules/network/edgeos/edgeos_facts.py +++ b/lib/ansible/modules/network/edgeos/edgeos_facts.py @@ -170,7 +170,7 @@ class Config(FactsBase): by=str(match.group(3)).strip(), via=str(match.group(4)).strip(), comment=None) - else: + elif entry: entry['comment'] = line.strip() self.facts['commits'] = entries