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"""