From 51ef12212b91387c95e3293d54d0f60bfb087cc8 Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Thu, 21 Dec 2023 23:34:39 +0000 Subject: [PATCH] [uss_qualifier] Check for presence of `includes_advisories` before accessing field (#439) Check for presence of `includes_advisories` before accessing field --- .../monitorlib/clients/flight_planning/client_v1.py | 5 ++++- .../resources/flight_planning/flight_planner.py | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/monitoring/monitorlib/clients/flight_planning/client_v1.py b/monitoring/monitorlib/clients/flight_planning/client_v1.py index 2eb3451e5c..d47178941f 100644 --- a/monitoring/monitorlib/clients/flight_planning/client_v1.py +++ b/monitoring/monitorlib/clients/flight_planning/client_v1.py @@ -16,6 +16,7 @@ ) from monitoring.monitorlib.clients.flight_planning.planning import ( PlanningActivityResponse, + AdvisoryInclusion, ) from monitoring.monitorlib.clients.flight_planning.planning import ( PlanningActivityResult, @@ -93,7 +94,9 @@ def _inject( queries=[query], activity_result=resp.planning_result, flight_plan_status=resp.flight_plan_status, - includes_advisories=resp.includes_advisories, + includes_advisories=resp.includes_advisories + if "includes_advisories" in resp + else AdvisoryInclusion.Unknown, ) return response diff --git a/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py b/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py index 08ce4214ba..81d34bb85d 100644 --- a/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py +++ b/monitoring/uss_qualifier/resources/flight_planning/flight_planner.py @@ -211,7 +211,14 @@ def request_flight( operational_intent_id="", ) - return response, resp.queries[0], flight_id, resp.includes_advisories + return ( + response, + resp.queries[0], + flight_id, + resp.includes_advisories + if "includes_advisories" in resp + else AdvisoryInclusion.Unknown, + ) def cleanup_flight( self, flight_id: str