Skip to content

Commit

Permalink
added region to the logging
Browse files Browse the repository at this point in the history
  • Loading branch information
1101-1 committed Nov 21, 2024
1 parent 46b7259 commit 48c7131
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion plugins/gcp/fix_plugin_gcp/resources/aiplatform.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def collect_resources(cls, builder: GraphBuilder, **kwargs: Any) -> List[GcpReso
if builder.region:
items = builder.client.list(spec, **kwargs)
collected_resources = cls.collect(items, builder)
log.info(f"[GCP:{builder.project.id}] finished collecting: {cls.kind}")
log.info(
f"[GCP:{builder.project.id}:{builder.region.safe_name}] finished collecting: {cls.kind}"
)
return collected_resources
return []

Expand Down
4 changes: 3 additions & 1 deletion plugins/gcp/fix_plugin_gcp/resources/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,9 @@ def collect_resources(cls: Type[GcpResource], builder: GraphBuilder, **kwargs: A
):
items = builder.client.list(spec, **kwargs)
resources = cls.collect(items, builder)
log.info(f"[GCP:{builder.project.id}] finished collecting: {cls.kind}")
log.info(
f"[GCP:{builder.project.id}:{builder.region.safe_name if builder.region else "global"}] finished collecting: {cls.kind}"
)
return resources
return []

Expand Down
4 changes: 3 additions & 1 deletion plugins/gcp/fix_plugin_gcp/resources/filestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ def collect_snapshots() -> None:
snapshots = GcpFilestoreInstanceSnapshot.collect(items, graph_builder)
for snapshot in snapshots:
graph_builder.add_edge(self, node=snapshot)
log.info(f"[GCP:{graph_builder.project.id}] finished collecting: {GcpFilestoreInstanceSnapshot.kind}")
log.info(
f"[GCP:{graph_builder.project.id}:{graph_builder.region.safe_name if graph_builder.region else "global"}] finished collecting: {GcpFilestoreInstanceSnapshot.kind}"
)

graph_builder.submit_work(collect_snapshots)

Expand Down
4 changes: 3 additions & 1 deletion plugins/gcp/fix_plugin_gcp/resources/firestore.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,9 @@ def collect_documents() -> None:
documents = GcpFirestoreDocument.collect(items, graph_builder)
for document in documents:
graph_builder.add_edge(self, node=document)
log.info(f"[GCP:{graph_builder.project.id}] finished collecting: {GcpFirestoreDocument.kind}")
log.info(
f"[GCP:{graph_builder.project.id}:{graph_builder.region.safe_name if graph_builder.region else "global"}] finished collecting: {GcpFirestoreDocument.kind}"
)

graph_builder.submit_work(collect_documents)

Expand Down

0 comments on commit 48c7131

Please sign in to comment.