Skip to content

Commit

Permalink
[aws][fix] indentation level (#1923)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias committed Feb 15, 2024
1 parent 66b7928 commit 053c786
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions plugins/aws/resoto_plugin_aws/resource/ecs.py
Expand Up @@ -2040,26 +2040,26 @@ def collect(cls: Type[AwsResource], json: List[Json], builder: GraphBuilder) ->
builder.add_node(task_instance, task)
builder.add_edge(cluster_instance, edge_type=EdgeType.default, node=task_instance)

# once all clusters are collected, collect capacity providers
provider_names = {name for instance in instances for name in instance.cluster_capacity_providers}
providers: Dict[str, AwsEcsCapacityProvider] = {}
for chunk in chunks(list(provider_names), 100):
for provider in builder.client.list(
service_name,
"describe-capacity-providers",
"capacityProviders",
capacityProviders=chunk,
include=["TAGS"],
):
if provider_instance := AwsEcsCapacityProvider.from_api(provider, builder):
builder.add_node(provider_instance, provider)
providers[provider_instance.safe_name] = provider_instance

# connect clusters to providers
for instance in instances:
for name in instance.cluster_capacity_providers:
if provider := providers.get(name):
builder.add_edge(instance, edge_type=EdgeType.default, node=provider)
# once all clusters are collected, collect capacity providers
provider_names = {name for instance in instances for name in instance.cluster_capacity_providers}
providers: Dict[str, AwsEcsCapacityProvider] = {}
for chunk in chunks(list(provider_names), 100):
for provider in builder.client.list(
service_name,
"describe-capacity-providers",
"capacityProviders",
capacityProviders=chunk,
include=["TAGS"],
):
if provider_instance := AwsEcsCapacityProvider.from_api(provider, builder):
builder.add_node(provider_instance, provider)
providers[provider_instance.safe_name] = provider_instance

# connect clusters to providers
for instance in instances:
for name in instance.cluster_capacity_providers:
if provider := providers.get(name):
builder.add_edge(instance, edge_type=EdgeType.default, node=provider)

def connect_in_graph(self, builder: GraphBuilder, source: Json) -> None:
# TODO add edge to CloudWatchLogs LogGroup when applicable
Expand Down

0 comments on commit 053c786

Please sign in to comment.