Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix linting errors
Browse files Browse the repository at this point in the history
Signed-off-by: Janine Olear <pninak@web.de>
  • Loading branch information
miyunari committed Jul 26, 2023
1 parent 2888cdc commit 5e9d3f1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/cloudimagedirectory/transform/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,8 @@ def run(self, data: type[Transformer]) -> list:
class TransformerV2ListRegionByVersion(Transformer):
"""Generate a list for all available regions for one version."""

def run(self, data):
@no_type_check
def run(self, data: type[Transformer]) -> list: # noqa: C901
# NOTE: check that its the v2 data entries.
entries = [x for x in data if x.is_API("v2")]

Expand All @@ -585,13 +586,13 @@ def run(self, data):
region = filename[8]

if os not in regions:
regions[os] = {provider : {}}
regions[os] = {provider: {}}

if provider not in regions[os]:
regions[os][provider] = {version : {}}
regions[os][provider] = {version: {}}

if version not in regions[os][provider]:
regions[os][provider][version] = {region : 1}
regions[os][provider][version] = {region: 1}
continue

if region not in regions[os][provider][version]:
Expand All @@ -605,5 +606,9 @@ def run(self, data):
for provider, version_map in region_map.items():
for version in version_map:
# NOTE: Add /list suffix to prevent collision with "region" folder.
results.append(connection.DataEntry(f"v2/os/{os}/provider/{provider}/version/{version}/region/list", version_map[version]))
results.append(
connection.DataEntry(
f"v2/os/{os}/provider/{provider}/version/{version}/region/list", version_map[version]
)
)
return results

0 comments on commit 5e9d3f1

Please sign in to comment.