Skip to content

Commit

Permalink
Update log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aarontp committed Nov 15, 2023
1 parent 75487af commit 748ce65
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions turbinia/workers/containerd.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,11 @@ def run(self, evidence, result):
image = container.get('Image')

if not namespace or not container_id:
result.log(
f'Value is empty. namespace={namespace}, '
f'container_id={container_id}')
report_data.append(
message = (
f'Skipping container with empty value namespace ({namespace})'
f' or container_id ({container_id})')
result.log(message)
report_data.append(message)
continue

# Filter out configured namespaces/containers/images
Expand Down Expand Up @@ -243,6 +242,10 @@ def run(self, evidence, result):
namespace=namespace, container_id=container_id)

result.add_evidence(container_evidence, evidence.config)
result.log(
f'Adding container evidence: id {container_id} '
f'name {container_name} type {container_type} image {image}')

summary = (
f'Found {len(container_ids)} containers: {", ".join(container_ids)}')
success = True
Expand All @@ -251,8 +254,8 @@ def run(self, evidence, result):
f'Filtered out {len(filtered_container_list)} containers: '
f'{{", ".join(filtered_container_list)}}')
report_data.append(
'To process filtered containers, adjust the ContainerEnumeration Task '
'filter* parameters with a recipe')
'To process filtered containers, adjust the ContainerEnumeration '
'Task config filter* parameters with a recipe')
except TurbiniaException as e:
summary = f'Error enumerating containerd containers: {e}'
report_data.append(summary)
Expand Down

0 comments on commit 748ce65

Please sign in to comment.