daemon: updated xml to save links using consistent iface1/2 naming, still fallback to reading interface_one/two

This commit is contained in:
Blake Harnden 2020-06-23 13:31:31 -07:00
parent 14573184e0
commit 9649337f18

View file

@ -520,14 +520,14 @@ class CoreXmlWriter:
# check for interface one # check for interface one
if link_data.iface1 is not None: if link_data.iface1 is not None:
iface1 = self.create_iface_element( iface1 = self.create_iface_element(
"interface1", link_data.node1_id, link_data.iface1 "iface1", link_data.node1_id, link_data.iface1
) )
link_element.append(iface1) link_element.append(iface1)
# check for interface two # check for interface two
if link_data.iface2 is not None: if link_data.iface2 is not None:
iface2 = self.create_iface_element( iface2 = self.create_iface_element(
"interface2", link_data.node2_id, link_data.iface2 "iface2", link_data.node2_id, link_data.iface2
) )
link_element.append(iface2) link_element.append(iface2)
@ -907,14 +907,14 @@ class CoreXmlReader:
node2_id = get_int(link_element, "node_two") node2_id = get_int(link_element, "node_two")
node_set = frozenset((node1_id, node2_id)) node_set = frozenset((node1_id, node2_id))
iface1_element = link_element.find("interface1") iface1_element = link_element.find("iface1")
if iface1_element is None: if iface1_element is None:
iface1_element = link_element.find("interface_one") iface1_element = link_element.find("interface_one")
iface1_data = None iface1_data = None
if iface1_element is not None: if iface1_element is not None:
iface1_data = create_iface_data(iface1_element) iface1_data = create_iface_data(iface1_element)
iface2_element = link_element.find("interface2") iface2_element = link_element.find("iface2")
if iface2_element is None: if iface2_element is None:
iface2_element = link_element.find("interface_two") iface2_element = link_element.find("interface_two")
iface2_data = None iface2_data = None