Error handling is done in the AntaDevice.refresh() function and if any Exception occurs, that should be propagated:
Suggested code:
async def connect_inventory(self) -> None:
"""Run `refresh()` coroutines for all AntaDevice objects in this inventory."""
logger.debug("Refreshing devices...")
results = await asyncio.gather( *(device.refresh() for device in self.values()))
When writing unit tests, I rediscovered the
connect_inventory()
coroutine that returns all exceptions and do not stop gathering coroutines: https://github.com/aristanetworks/anta/blob/main/anta/inventory/__init__.py#L307Error handling is done in the
AntaDevice.refresh()
function and if any Exception occurs, that should be propagated:Suggested code: