You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The qe_query returns None or [] in case of not matching queries. The function below is doing raise AosAPIError in case it finds nothing. It seems to be more consistent to return None rather than raise.
design.py
class AosLogicalDevices(AosSubsystem):
def get_logical_device(self, ld_id: str = None, ld_name: str = None):
if ld_name:
log_dev = self.get_all()
if log_dev:
for ld in log_dev:
if ld.get("display_name") == ld_name:
return ld
raise AosAPIError(f"Logical Device {ld_name} not found") <<<< current
return None <<<< proposing
return self.rest.json_resp_get(f"/api/design/logical-devices/{ld_id}")
The text was updated successfully, but these errors were encountered:
The qe_query returns None or [] in case of not matching queries. The function below is doing raise AosAPIError in case it finds nothing. It seems to be more consistent to return None rather than raise.
design.py
The text was updated successfully, but these errors were encountered: