fix linting

This commit is contained in:
Michael Jerger 2023-05-26 15:38:12 +02:00
parent 406a5e6333
commit da872af76e
5 changed files with 18 additions and 13 deletions

View file

@ -2,7 +2,7 @@ from pathlib import Path
from dda_python_terraform import Terraform, IsFlagged from dda_python_terraform import Terraform, IsFlagged
from packaging import version from packaging import version
from ..domain import Devops, TerraformDomain, BuildType from ..domain import Devops, BuildType
from ..infrastructure import FileApi, ResourceApi, TerraformApi from ..infrastructure import FileApi, ResourceApi, TerraformApi
@ -76,7 +76,7 @@ class TerraformService:
# TODO: internal? # TODO: internal?
def init_client(self, devops: Devops): def init_client(self, devops: Devops):
terraform_domain: TerraformDomain = devops.specialized_builds[ terraform_domain = devops.specialized_builds[
BuildType.TERRAFORM BuildType.TERRAFORM
] ]
terraform = Terraform( terraform = Terraform(

View file

@ -38,9 +38,15 @@ class InitService:
) )
def initialize(self, inp: dict) -> Devops: def initialize(self, inp: dict) -> Devops:
build_types = self.devops_factory.__parse_build_types__(inp.get("build_types", [])) build_types = self.devops_factory.__parse_build_types__(
mixin_types = self.devops_factory.__parse_mixin_types__(inp.get("mixin_types", [])) inp.get("build_types", [])
provider_types = TerraformDomain.parse_provider_types(inp.get("tf_provider_types", [])) )
mixin_types = self.devops_factory.__parse_mixin_types__(
inp.get("mixin_types", [])
)
provider_types = TerraformDomain.parse_provider_types(
inp.get("tf_provider_types", [])
)
version = None version = None
default_mappings = [] default_mappings = []

View file

@ -1,4 +1,4 @@
from typing import List, Dict, Set from typing import List, Dict, Set, Any
from .common import Validateable, CredentialMappingDefault from .common import Validateable, CredentialMappingDefault
@ -61,7 +61,7 @@ class Digitalocean(Validateable, CredentialMappingDefault):
) )
return result return result
def backend_config(self) -> map: def backend_config(self) -> Dict[str, Any]:
result = {} result = {}
if self.do_as_backend: if self.do_as_backend:
result = { result = {

View file

@ -1,6 +1,7 @@
from typing import List, Dict, Set from typing import List, Dict, Set
from .common import Validateable, CredentialMappingDefault from .common import Validateable, CredentialMappingDefault
class Hetzner(Validateable, CredentialMappingDefault): class Hetzner(Validateable, CredentialMappingDefault):
def __init__( def __init__(
self, self,
@ -17,9 +18,7 @@ class Hetzner(Validateable, CredentialMappingDefault):
return {"provider_registry.tf", "hetzner_provider.tf", "hetzner_mixin_vars.tf"} return {"provider_registry.tf", "hetzner_provider.tf", "hetzner_mixin_vars.tf"}
def project_vars(self): def project_vars(self):
return { return {"hetzner_api_key": self.hetzner_api_key}
"hetzner_api_key": self.hetzner_api_key
}
def is_local_state(self): def is_local_state(self):
return True return True

View file

@ -83,7 +83,7 @@ class TerraformDomain(Validateable):
result = result and provider.is_local_state() result = result and provider.is_local_state()
return result return result
def backend_config(self) -> map: def backend_config(self) -> Dict[str, Any]:
result = {} result = {}
for provider in self.providers.values(): for provider in self.providers.values():
result.update(provider.backend_config()) result.update(provider.backend_config())