Skip to content

Commit

Permalink
add workaround for pinfo warning output (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
hacktobeer authored and aarontp committed Jan 17, 2024
1 parent aec786b commit 5f00e9b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions turbinia/evidence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,8 @@ def _validate(self):
log.info(f'Running pinfo.py to validate PlasoFile {self.local_path}')
command = subprocess.run(cmd, capture_output=True, check=True)
storage_counters_json = command.stdout.decode('utf-8').strip()
# pinfo.py might print warnings (non-json) so we only need to last line of output
storage_counters_json = storage_counters_json.splitlines()[-1]
storage_counters = json.loads(storage_counters_json)
total_file_events = storage_counters.get('storage_counters', {}).get(
'parsers', {}).get('total', 0)
Expand Down

0 comments on commit 5f00e9b

Please sign in to comment.