Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update vrrp #57916

Merged
merged 1 commit into from
Jun 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 7 additions & 8 deletions lib/ansible/modules/network/cloudengine/ce_vrrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def get_virtual_ip_info(self):
virtual_ip_info["vrrpVirtualIpInfos"] = list()
root = ElementTree.fromstring(xml_str)
vrrp_virtual_ip_infos = root.findall(
"data/vrrp/vrrpGroups/vrrpGroup/virtualIps/virtualIp")
"vrrp/vrrpGroups/vrrpGroup/virtualIps/virtualIp")
if vrrp_virtual_ip_infos:
for vrrp_virtual_ip_info in vrrp_virtual_ip_infos:
virtual_ip_dict = dict()
Expand All @@ -508,7 +508,7 @@ def get_vrrp_global_info(self):

root = ElementTree.fromstring(xml_str)
global_info = root.findall(
"data/vrrp/vrrpGlobalCfg")
"vrrp/vrrpGlobalCfg")

if global_info:
for tmp in global_info:
Expand All @@ -532,7 +532,7 @@ def get_vrrp_group_info(self):

root = ElementTree.fromstring(xml_str)
global_info = root.findall(
"data/vrrp/vrrpGroups/vrrpGroup")
"vrrp/vrrpGroups/vrrpGroup")

if global_info:
for tmp in global_info:
Expand Down Expand Up @@ -693,12 +693,11 @@ def is_vrrp_global_info_exist(self):

def is_vrrp_group_info_change(self):
"""whether vrrp group attribute info change"""

if self.vrrp_type:
if self.vrrp_group_info["vrrpType"] != self.vrrp_type:
return True
if self.admin_ignore_if_down:
if self.vrrp_group_info["adminIgnoreIfDown"] != self.admin_ignore_if_down:
if self.vrrp_group_info["adminIgnoreIfDown"] != str(self.admin_ignore_if_down).lower():
return True
if self.admin_vrid:
if self.vrrp_group_info["adminVrrpId"] != self.admin_vrid:
Expand Down Expand Up @@ -745,7 +744,7 @@ def is_vrrp_group_info_exist(self):
if self.vrrp_group_info["vrrpType"] != self.vrrp_type:
return False
if self.admin_ignore_if_down:
if self.vrrp_group_info["adminIgnoreIfDown"] != self.admin_ignore_if_down:
if self.vrrp_group_info["adminIgnoreIfDown"] != str(self.admin_ignore_if_down).lower():
return False
if self.admin_vrid:
if self.vrrp_group_info["adminVrrpId"] != self.admin_vrid:
Expand Down Expand Up @@ -1174,7 +1173,7 @@ def get_existing(self):
self.existing["vrrp_type"] = self.vrrp_group_info["vrrpType"]
if self.vrrp_type == "admin":
self.existing["admin_ignore_if_down"] = self.vrrp_group_info[
"authenticationMode"]
"adminIgnoreIfDown"]
if self.admin_vrid and self.admin_interface:
self.existing["admin_vrid"] = self.vrrp_group_info[
"adminVrrpId"]
Expand Down Expand Up @@ -1237,7 +1236,7 @@ def get_end_state(self):
self.end_state["vrrp_type"] = self.vrrp_group_info["vrrpType"]
if self.vrrp_type == "admin":
self.end_state["admin_ignore_if_down"] = self.vrrp_group_info[
"authenticationMode"]
"adminIgnoreIfDown"]
if self.admin_vrid and self.admin_interface:
self.existing["admin_vrid"] = self.vrrp_group_info[
"adminVrrpId"]
Expand Down