Tries to return a single Trace mathing component_filter. Raises an exception when a filter matches multiple.
(**component_filter)
| 71 | |
| 72 | |
| 73 | def _get_single_trace_by_component(**component_filter): |
| 74 | """ |
| 75 | Tries to return a single Trace mathing component_filter. Raises an exception |
| 76 | when a filter matches multiple. |
| 77 | """ |
| 78 | traces = Trace.query(**component_filter) |
| 79 | if len(traces) == 0: |
| 80 | return None |
| 81 | elif len(traces) > 1: |
| 82 | raise UniqueTraceNotFoundException( |
| 83 | "More than 1 trace matching %s found." % component_filter |
| 84 | ) |
| 85 | return traces[0] |
| 86 | |
| 87 | |
| 88 | def get_trace_db_by_action_execution(action_execution=None, action_execution_id=None): |
no test coverage detected