Skip to content

Commit

Permalink
Removed lines from URLs to fix a bug with sphinx
Browse files Browse the repository at this point in the history
The Sphinx tests were crashing because Sphinx is no longer supporting GitHub URLs with lines.
  • Loading branch information
Igor8mr committed Jul 21, 2023
1 parent edc2d2f commit 3dce6fc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/developer/developing-new-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ etc) prior to execution by setting the state in `Task.REQUIRED_STATES`. Each
Evidence object specifies which states it supports in the
`Evidence.POSSIBLE_STATES` list attribute for that Task (e.g. see the
[`GoogleCloudDisk` possible states
here](https:/google/turbinia/blob/cc79288ae36cfec749381b80694b4c1290d76583/turbinia/evidence.py#L661)).
here - Line 717](https:/google/turbinia/blob/master/turbinia/evidence.py)).
These states are set up by the pre-processors and then after the Task is
completed, the post-processor will tear down this state (e.g. unmount or
detach, etc). For more details on the different states and how the
pre/post-processors will set these up at runtime, see the
[`Evidence.preprocess()`
docstrings](https:/google/turbinia/blob/cc79288ae36cfec749381b80694b4c1290d76583/turbinia/evidence.py#L291).
docstrings - Line 405](https:/google/turbinia/blob/master/turbinia/evidence.py).

### Evidence Paths

Expand All @@ -144,7 +144,7 @@ generally this should not be needed as long as you set the
`TurbiniaTask.REQUIRED_STATES` for the Task to match your actual requirements
since the `local_path` should always be created by the pre-processors.
See the [docstrings for these attributes in the Evidence
object](https:/google/turbinia/blob/cc79288ae36cfec749381b80694b4c1290d76583/turbinia/evidence.py#L127)
object - Line 203](https:/google/turbinia/blob/master/turbinia/evidence.py)
for more details.

### Recipe configuration
Expand All @@ -155,7 +155,7 @@ should be run. Each Task has a `TASK_CONFIG` dictionary set at the object
level that defines each of the variables that can be used along with the
default values that the Task will use when the recipe does not specify that
variable, or there is no recipe used. See the [Plaso
Task](https:/google/turbinia/blob/8aafea5d4ba165aa72748ed7f1f196c8b9d7175c/turbinia/workers/plaso.py#L35)
Task - Line 29](https:/google/turbinia/blob/master/turbinia/workers/plaso.py)
`TASK_CONFIG` as an example. Tasks can access these variables by referencing
the dictionary at `self.task_config`.

Expand Down
4 changes: 2 additions & 2 deletions docs/user/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ with the defaults:

These generally correlate with similarly named command line flags. The current
full list can be [found
here](https:/google/turbinia/blob/8aafea5d4ba165aa72748ed7f1f196c8b9d7175c/turbinia/lib/recipe_helpers.py#L28).
here - Line 36](https:/google/turbinia/blob/master/turbinia/lib/recipe_helpers.py).
Each Task specifies the available recipe keys in a `TASK_CONFIG` attribute for
the Task object (e.g. [here is the `TASK_CONFIG` for the Plaso
Task](https:/google/turbinia/blob/8aafea5d4ba165aa72748ed7f1f196c8b9d7175c/turbinia/workers/plaso.py#L35)).
Task - Line 141](https:/google/turbinia/blob/master/turbinia/workers/plaso.py)).


Here is a [real sample of the `all` Recipe](https:/google/turbinia/blob/master/turbinia/config/recipes/all.yaml)
Expand Down
12 changes: 4 additions & 8 deletions turbinia/api/routes/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ async def get_requests_summary(request: Request):
return JSONResponse(
content={'detail': 'Request summary is empty'}, status_code=200)
response_json = requests_summary.model_dump_json()
response = json.loads(response_json)
if isinstance(response, dict):
response = OrderedDict(sorted(response.items()))
response = OrderedDict(sorted(json.loads(response_json).items()))
return JSONResponse(
status_code=200, content=response, media_type='application/json')
except (json.JSONDecodeError, TypeError, ValueError,
except (json.JSONDecodeError, TypeError, ValueError, AttributeError,
ValidationError) as exception:
log.error(
f'Error retrieving requests summary: {exception!s}', exc_info=True)
Expand All @@ -81,12 +79,10 @@ async def get_request_status(request: Request, request_id: str):
status_code=404,
detail='Request ID not found or the request had no associated tasks.')
response_json = request_out.model_dump_json()
response = json.loads(response_json)
if isinstance(response, dict):
response = OrderedDict(sorted(response.items()))
response = OrderedDict(sorted(json.loads(response_json).items()))
return JSONResponse(
status_code=200, content=response, media_type='application/json')
except (json.JSONDecodeError, TypeError, ValueError,
except (json.JSONDecodeError, TypeError, ValueError, AttributeError,
ValidationError) as exception:
log.error(f'Error retrieving request information: {exception!s}')
raise HTTPException(
Expand Down

0 comments on commit 3dce6fc

Please sign in to comment.