Skip to content

Commit

Permalink
GCP Resource Tree bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dfjxs committed Sep 27, 2024
1 parent 5637f40 commit 14c5ad9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dftimewolf/lib/processors/gcp_cloud_resource_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,14 @@ def _ParseLogMessages(self, log_messages: List[Dict[str, Any]]) -> None:

# Parse logs for supported resource types
if log_message_type.startswith(
('compute.instances', 'compute.disks', 'compute.machineImages',
'compute.image', 'compute.instanceTemplates', 'compute.snapshots')):
('compute.instances', 'compute.regionInstances', 'compute.disks',
'compute.regionDisks', 'compute.machineImages', 'compute.image',
'compute.instanceTemplates', 'compute.regionInstanceTemplates',
'compute.snapshots')):
# Only parse 'operation' responses, skipping errors
if response.get('@type').split('/')[-1] != 'operation':
if (
response.get('@type') is None or
response.get('@type').split('/')[-1] != 'operation'):
continue

# Check if a resource with the same ID already exist in the
Expand Down

0 comments on commit 14c5ad9

Please sign in to comment.