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 0000000000..7953d8a682 --- /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 e59fc0be0e..22c9127ed0 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)