infamy: route: ospf: Adopt to changes done in 2c88e1bdf5

Now there is no guarantee that the control-plane-protocol array
exist in operational.
This commit is contained in:
Mattias Walström
2024-05-24 11:58:47 +02:00
committed by Tobias Waldekranz
parent 05a46475ed
commit c4d567f994
+2 -2
View File
@@ -40,8 +40,8 @@ def ipv6_route_exist(target, prefix, nexthop=None,source_protocol=None):
def _get_ospf_status(target):
xpath="/ietf-routing:routing/control-plane-protocols/control-plane-protocol/ietf-ospf:ospf"
rib = target.get_data(xpath)["routing"]["control-plane-protocols"]["control-plane-protocol"]
xpath="/ietf-routing:routing/control-plane-protocols"
rib = target.get_data(xpath)["routing"]["control-plane-protocols"].get("control-plane-protocol", {})
for p in rib:
if p["type"] == "ietf-ospf:ospfv2":
return p["ospf"]