From 143bafec9a506aff8f42ca573c7006a8c5549e12 Mon Sep 17 00:00:00 2001 From: GomathiselviS Date: Wed, 13 Nov 2019 09:31:21 -0500 Subject: [PATCH] =?UTF-8?q?eos=5Flacp=5Finterfaces=20:=20Fix=20to=20-=20la?= =?UTF-8?q?cp=20port-priority=20not=20set=20when=E2=80=A6=20(#64530)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix bug 64453 --- .../network/eos/config/lacp_interfaces/lacp_interfaces.py | 6 +++--- .../targets/eos_lacp_interfaces/tests/cli/replaced.yaml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/network/eos/config/lacp_interfaces/lacp_interfaces.py b/lib/ansible/module_utils/network/eos/config/lacp_interfaces/lacp_interfaces.py index 6af98a51cca..ffd2f366765 100644 --- a/lib/ansible/module_utils/network/eos/config/lacp_interfaces/lacp_interfaces.py +++ b/lib/ansible/module_utils/network/eos/config/lacp_interfaces/lacp_interfaces.py @@ -199,15 +199,15 @@ class Lacp_interfaces(ConfigBase): def generate_commands(interface, to_set, to_remove): commands = [] + for key in to_remove.keys(): + commands.append("no lacp {0}".format(key.replace("_", "-"))) + for key, value in to_set.items(): if value is None: continue commands.append("lacp {0} {1}".format(key.replace("_", "-"), value)) - for key in to_remove.keys(): - commands.append("no lacp {0}".format(key.replace("_", "-"))) - if commands: commands.insert(0, "interface {0}".format(interface)) diff --git a/test/integration/targets/eos_lacp_interfaces/tests/cli/replaced.yaml b/test/integration/targets/eos_lacp_interfaces/tests/cli/replaced.yaml index d11c350128e..f33b32fd15e 100644 --- a/test/integration/targets/eos_lacp_interfaces/tests/cli/replaced.yaml +++ b/test/integration/targets/eos_lacp_interfaces/tests/cli/replaced.yaml @@ -5,6 +5,7 @@ config: - name: Ethernet1 rate: fast + port_priority: 45 other_config: - name: Ethernet2 rate: fast