From 4052c790cd5ea02a1aa2ecb046b870f24e10f18b Mon Sep 17 00:00:00 2001 From: yanzhangi <51999930+yanzhangi@users.noreply.github.com> Date: Thu, 19 Sep 2019 00:41:12 +0800 Subject: [PATCH] [Backport/2.8/61995]update ce_vxlan_arp to fix bugs (#62504) * Update ce_vxlan_arp to fix bugs (#61995) * Update ce_vxlan_arp to fix bugs * Update ce_vxlan_arp to fix bugs (cherry picked from commit 12512f731984ecb5bacb750e555dc4ef697c2b12) * update ce_vxlan_arp to fix bugs --- changelogs/fragments/61995-ce_vxlan_arp-to-fix-bugs.yml | 2 ++ lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/61995-ce_vxlan_arp-to-fix-bugs.yml diff --git a/changelogs/fragments/61995-ce_vxlan_arp-to-fix-bugs.yml b/changelogs/fragments/61995-ce_vxlan_arp-to-fix-bugs.yml new file mode 100644 index 00000000000..1431f0c08ba --- /dev/null +++ b/changelogs/fragments/61995-ce_vxlan_arp-to-fix-bugs.yml @@ -0,0 +1,2 @@ +bugfixes: +- ce_vxlan_arp - update to fix some bugs - Modifying regular expressions. (https://github.com/ansible/ansible/pull/61995) diff --git a/lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py b/lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py index 1cd6c91c9a4..72d1d985052 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py +++ b/lib/ansible/modules/network/cloudengine/ce_vxlan_arp.py @@ -286,12 +286,12 @@ class VxlanArp(object): """get current configuration""" flags = list() - exp = "| ignore-case section include evn bgp|host collect protocol bgp" + exp = r"| ignore-case section include evn bgp|host collect protocol bgp" if self.vbdif_name: - exp += "|^interface %s$" % self.vbdif_name + exp += r"|^#\s+interface %s\s+" % self.vbdif_name.lower().capitalize().replace(" ", "") if self.bridge_domain_id: - exp += "|^bridge-domain %s$" % self.bridge_domain_id + exp += r"|^#\s+bridge-domain %s\s+" % self.bridge_domain_id flags.append(exp) cfg_str = self.get_config(flags)