From 242f160747638fda253d7ac7e96ea4a5c4d0c03e Mon Sep 17 00:00:00 2001 From: YuandongXu <786018072@qq.com> Date: Fri, 28 Jun 2019 09:42:08 +0800 Subject: [PATCH] update ce_vxlan_global to fix bugs. (#57947) * update to fix bugs. * add a changelog fragment. * update a changelog fragment. --- .../fragments/57947-update-ce_vxlan_global-to-fix-bugs.yml | 4 ++++ lib/ansible/modules/network/cloudengine/ce_vxlan_global.py | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/57947-update-ce_vxlan_global-to-fix-bugs.yml diff --git a/changelogs/fragments/57947-update-ce_vxlan_global-to-fix-bugs.yml b/changelogs/fragments/57947-update-ce_vxlan_global-to-fix-bugs.yml new file mode 100644 index 00000000000..9574776a387 --- /dev/null +++ b/changelogs/fragments/57947-update-ce_vxlan_global-to-fix-bugs.yml @@ -0,0 +1,4 @@ +bugfixes: + - ce_vxlan_global - line 242 , bd_info is a string array,and it should be 'extend' operation. + - ce_vxlan_global - line 423, 'if' and 'else' should set a different value. if 'exist', that value is 'enable'. + - ce_vxlan_global - line 477. To get state of result, if it is changed or not. diff --git a/lib/ansible/modules/network/cloudengine/ce_vxlan_global.py b/lib/ansible/modules/network/cloudengine/ce_vxlan_global.py index b52924f44f4..7c800612c5c 100644 --- a/lib/ansible/modules/network/cloudengine/ce_vxlan_global.py +++ b/lib/ansible/modules/network/cloudengine/ce_vxlan_global.py @@ -239,7 +239,7 @@ class VxlanGlobal(object): if not bd_str: return bd_info bd_num = re.findall(r'bridge-domain\s*([0-9]+)', bd_str) - bd_info.append(bd_num) + bd_info.extend(bd_num) return bd_info def config_bridge_domain(self): @@ -420,7 +420,7 @@ class VxlanGlobal(object): cmd = "assign forward nvo3 ecmp hash enable" exist = is_config_exist(self.config, cmd) if exist: - self.existing["nvo3_ecmp_hash"] = "disable" + self.existing["nvo3_ecmp_hash"] = "enable" else: self.existing["nvo3_ecmp_hash"] = "disable" @@ -474,6 +474,8 @@ class VxlanGlobal(object): self.end_state["nvo3_ecmp_hash"] = "enable" else: self.end_state["nvo3_ecmp_hash"] = "disable" + if self.existing == self.end_state: + self.changed = True def work(self): """worker"""