Skip to content

Commit

Permalink
[uss_qualifier/resources/f3548/dss/delete_op_intent] Fix use of Query…
Browse files Browse the repository at this point in the history
…Error for error handling (#498)
  • Loading branch information
mickmis authored Feb 9, 2024
1 parent 52ddead commit 1a6af82
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions monitoring/uss_qualifier/resources/astm/f3548/v21/dss.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ def delete_op_intent(
id: str,
ovn: str,
) -> Tuple[OperationalIntentReference, List[SubscriberToNotify], Query]:
"""
Delete an operational intent.
Raises:
* QueryError: if request failed, if HTTP status code is different than 200, or if the parsing of the response failed.
"""
self._uses_scope(Scope.StrategicCoordination)
op = OPERATIONS[OperationID.DeleteOperationalIntentReference]
query = query_and_describe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def remove_op_intent(
scenario.record_query(query)
except fetch.QueryError as e:
scenario.record_queries(e.queries)
query = e.queries[0]
check.record_failed(
summary=f"Could not remove op intent reference {oi_id}",
details=f"When attempting to remove op intent reference {oi_id} from the DSS, received {query.status_code}; {e}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def _clear_op_intents(self):
self.record_query(del_query)
except QueryError as e:
self.record_queries(e.queries)
del_query = e.queries[0]
check.record_failed(
summary=f"Failed to delete op intent {oi_ref.id} from DSS",
details=f"DSS responded code {del_query.status_code}; error message: {del_query.error_message}; {e}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def _clean_known_op_intents_ids(self):
self.record_query(dq)
except QueryError as e:
self.record_queries(e.queries)
dq = e.queries[0]
check.record_failed(
f"Could not delete operational intent using main credentials",
details=f"DSS responded with {dq.response.status_code} to attempt to delete OI {self._oid_1}; {e}",
Expand Down Expand Up @@ -201,6 +202,7 @@ def _clean_known_op_intents_ids(self):
self.record_query(dq)
except QueryError as e:
self.record_queries(e.queries)
dq = e.queries[0]
check.record_failed(
f"Could not delete operational intent using second credentials",
details=f"DSS responded with {dq.response.status_code} to attempt to delete OI {self._oid_2}; {e}",
Expand Down Expand Up @@ -241,6 +243,7 @@ def _attempt_to_delete_remaining_op_intents(self):
self.record_query(dq)
except QueryError as e:
self.record_queries(e.queries)
dq = e.queries[0]
check.record_failed(
f"Could not delete operational intent using main credentials",
details=f"DSS responded with {dq.response.status_code} to attempt to delete OI {op_intent.id}; {e}",
Expand Down Expand Up @@ -282,6 +285,7 @@ def _attempt_to_delete_remaining_op_intents(self):
self.record_query(dq)
except QueryError as e:
self.record_queries(e.queries)
dq = e.queries[0]
check.record_failed(
f"Could not delete operational intent using second credentials",
details=f"DSS responded with {dq.response.status_code} to attempt to delete OI {op_intent.id}; {e}",
Expand Down

0 comments on commit 1a6af82

Please sign in to comment.