Protect API calls that are missing, print a warning
This commit is contained in:
@ -306,9 +306,7 @@ class VPPApi:
|
|||||||
self.cache["lcps"][lcp.phy_sw_if_index] = lcp
|
self.cache["lcps"][lcp.phy_sw_if_index] = lcp
|
||||||
self.lcp_enabled = True
|
self.lcp_enabled = True
|
||||||
except AttributeError as err:
|
except AttributeError as err:
|
||||||
self.logger.warning(
|
self.logger.warning(f"LinuxCP API not found - missing plugin: {err}")
|
||||||
f"linux-cp not found, will not reconcile Linux Control Plane: {err}"
|
|
||||||
)
|
|
||||||
|
|
||||||
self.logger.debug("Retrieving interfaces")
|
self.logger.debug("Retrieving interfaces")
|
||||||
api_response = self.vpp.api.sw_interface_dump()
|
api_response = self.vpp.api.sw_interface_dump()
|
||||||
@ -333,10 +331,15 @@ class VPPApi:
|
|||||||
str(addr.prefix)
|
str(addr.prefix)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
try: ## TODO(pim): Remove after 23.10 release
|
||||||
self.logger.debug("Retrieving interface MPLS state")
|
self.logger.debug("Retrieving interface MPLS state")
|
||||||
api_response = self.vpp.api.mpls_interface_dump()
|
api_response = self.vpp.api.mpls_interface_dump()
|
||||||
for iface in api_response:
|
for iface in api_response:
|
||||||
self.cache["interface_mpls"][iface.sw_if_index] = True
|
self.cache["interface_mpls"][iface.sw_if_index] = True
|
||||||
|
except AttributeError:
|
||||||
|
self.logger.warning(
|
||||||
|
f"MPLS state retrieval requires https://gerrit.fd.io/r/c/vpp/+/39022"
|
||||||
|
)
|
||||||
|
|
||||||
self.logger.debug("Retrieving bondethernets")
|
self.logger.debug("Retrieving bondethernets")
|
||||||
api_response = self.vpp.api.sw_bond_interface_dump()
|
api_response = self.vpp.api.sw_bond_interface_dump()
|
||||||
@ -355,10 +358,13 @@ class VPPApi:
|
|||||||
for bridge in api_response:
|
for bridge in api_response:
|
||||||
self.cache["bridgedomains"][bridge.bd_id] = bridge
|
self.cache["bridgedomains"][bridge.bd_id] = bridge
|
||||||
|
|
||||||
|
try:
|
||||||
self.logger.debug("Retrieving vxlan_tunnels")
|
self.logger.debug("Retrieving vxlan_tunnels")
|
||||||
api_response = self.vpp.api.vxlan_tunnel_v2_dump()
|
api_response = self.vpp.api.vxlan_tunnel_v2_dump()
|
||||||
for vxlan in api_response:
|
for vxlan in api_response:
|
||||||
self.cache["vxlan_tunnels"][vxlan.sw_if_index] = vxlan
|
self.cache["vxlan_tunnels"][vxlan.sw_if_index] = vxlan
|
||||||
|
except AttributeError as err:
|
||||||
|
self.logger.warning(f"VXLAN API not found - missing plugin: {err}")
|
||||||
|
|
||||||
self.logger.debug("Retrieving L2 Cross Connects")
|
self.logger.debug("Retrieving L2 Cross Connects")
|
||||||
api_response = self.vpp.api.l2_xconnect_dump()
|
api_response = self.vpp.api.l2_xconnect_dump()
|
||||||
|
Reference in New Issue
Block a user