Protect API calls that are missing, print a warning

This commit is contained in:
Pim van Pelt
2023-06-11 18:55:44 +02:00
parent 603e26a313
commit 28b8ba1485

View File

@ -382,6 +382,16 @@ class VPPApi:
f"MPLS state retrieval requires https://gerrit.fd.io/r/c/vpp/+/39022"
)
try: ## TODO(pim): Remove after 23.10 release
self.logger.debug("Retrieving interface MPLS state")
api_response = self.vpp.api.mpls_interface_dump()
for iface in api_response:
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"
)
try:
self.logger.debug("Retrieving ACLs")
api_response = self.vpp.api.acl_dump(acl_index=0xFFFFFFFF)