From da72644317615db7a52cf0c5544ae1c442db9457 Mon Sep 17 00:00:00 2001 From: YuandongXu <786018072@qq.com> Date: Sat, 29 Jun 2019 04:03:48 +0800 Subject: [PATCH] update acl interface. (#57905) * update acl interface. * update ce_interface * update * add a changelog fragment. * update --- .../fragments/57905-update-ce_acl_interface-to-fix-bugs.yml | 2 ++ lib/ansible/modules/network/cloudengine/ce_acl_interface.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/57905-update-ce_acl_interface-to-fix-bugs.yml diff --git a/changelogs/fragments/57905-update-ce_acl_interface-to-fix-bugs.yml b/changelogs/fragments/57905-update-ce_acl_interface-to-fix-bugs.yml new file mode 100644 index 00000000000000..27b52a4ca2cc50 --- /dev/null +++ b/changelogs/fragments/57905-update-ce_acl_interface-to-fix-bugs.yml @@ -0,0 +1,2 @@ +bugfixes: + - ce_acl_interface - Strict regularity can't find anything. diff --git a/lib/ansible/modules/network/cloudengine/ce_acl_interface.py b/lib/ansible/modules/network/cloudengine/ce_acl_interface.py index 837f85d4e39da0..321cedb30906ff 100644 --- a/lib/ansible/modules/network/cloudengine/ce_acl_interface.py +++ b/lib/ansible/modules/network/cloudengine/ce_acl_interface.py @@ -169,7 +169,7 @@ def check_args(self): msg='Error: The len of acl_name is out of [1 - 32].') if self.interface: - cmd = "display current-configuration | ignore-case section include ^interface %s$" % self.interface + cmd = "display current-configuration | ignore-case section include interface %s" % self.interface rc, out, err = exec_command(self.module, cmd) if rc != 0: self.module.fail_json(msg=err) @@ -199,7 +199,7 @@ def get_proposed(self): def get_existing(self): """ Get existing config """ - cmd = "display current-configuration | ignore-case section include ^interface %s$ | include traffic-filter" % self.interface + cmd = "display current-configuration | ignore-case section include interface %s | include traffic-filter" % self.interface rc, out, err = exec_command(self.module, cmd) if rc != 0: self.module.fail_json(msg=err) @@ -217,7 +217,7 @@ def get_existing(self): def get_end_state(self): """ Get config end state """ - cmd = "display current-configuration | ignore-case section include ^interface %s$ | include traffic-filter" % self.interface + cmd = "display current-configuration | ignore-case section include interface %s | include traffic-filter" % self.interface rc, out, err = exec_command(self.module, cmd) if rc != 0: self.module.fail_json(msg=err)