Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[uss_qualifier/resources/f3548/dss/delete_op_intent] Fix use of QueryError for error handling #498

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -286,6 +286,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 @@ -294,6 +294,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 @@ -161,6 +161,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 @@ -190,6 +191,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 @@ -226,6 +228,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 @@ -264,6 +267,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
Loading