From 6491c5cdd7ddf4270efb04bb27c35a483d48458c Mon Sep 17 00:00:00 2001 From: Xu Yuandong Date: Thu, 18 Jul 2019 03:14:48 +0800 Subject: [PATCH] =?UTF-8?q?Backport/2.8/58226=20ce=5Fvxlan=5Fgateway:=20up?= =?UTF-8?q?date=20the=20regular=20expression=20to=20match=20the=20more=20a?= =?UTF-8?q?cc=E2=80=A6=20(#58557)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ce_vxlan_gateway: update the regular expression to match the more accurate. (#58226) * Update the regular expression to match the more accurate * Update the regular expression to match the more accurate * Update the regular expression to match the more accurate (cherry picked from commit 2f91266aa9b5ac682889829505f4c1d738057942) * add a changlog fragment to PR 58557. * Update 58226-update-ce_vxlan_gateway-to-fix-a-bug.yml --- .../58226-update-ce_vxlan_gateway-to-fix-a-bug.yml | 2 ++ lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/58226-update-ce_vxlan_gateway-to-fix-a-bug.yml diff --git a/changelogs/fragments/58226-update-ce_vxlan_gateway-to-fix-a-bug.yml b/changelogs/fragments/58226-update-ce_vxlan_gateway-to-fix-a-bug.yml new file mode 100644 index 00000000000..7953d8a6825 --- /dev/null +++ b/changelogs/fragments/58226-update-ce_vxlan_gateway-to-fix-a-bug.yml @@ -0,0 +1,2 @@ +bugfixes: + - ce_vxlan_gateway - update the regular expression to match the more.(https://github.com/ansible/ansible/pull/58226) diff --git a/lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py b/lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py index e59fc0be0e4..22c9127ed0f 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py +++ b/lib/ansible/modules/network/cloudengine/ce_vxlan_gateway.py @@ -398,11 +398,11 @@ class VxlanGateway(object): """get current configuration""" flags = list() - exp = " | ignore-case section include dfs-group" + exp = r" | ignore-case section include ^#\s+dfs-group" if self.vpn_instance: - exp += "|^ip vpn-instance %s$" % self.vpn_instance + exp += r"|^#\s+ip vpn-instance %s" % self.vpn_instance if self.vbdif_name: - exp += "|^interface %s$" % self.vbdif_name + exp += r"|^#\s+interface %s" % self.vbdif_name flags.append(exp) return self.get_config(flags)