From b0b3f1bf55a6b68d7a3e5d84ef627c63a89b6b6e Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Sun, 28 May 2023 17:15:25 +0200 Subject: [PATCH] fixed last missing pieces --- .gitlab-ci.yml | 2 +- build.py | 2 +- src/main/python/ddadevops/application/terraform_service.py | 4 +--- src/main/python/ddadevops/domain/provider_hetzner.py | 3 +-- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 ++-- 5 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dff5793..4a0dd96 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,7 @@ flake8: script: - pip install -r dev_requirements.txt - flake8 --max-line-length=120 --count --select=E9,F63,F7,F82 --show-source --statistics src/main/python/ddadevops/ - - flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics src/main/python/ddadevops/ + - flake8 --count --exit-zero --max-complexity=10 --max-line-length=127 --per-file-ignores="__init__.py:F401" --ignore=E722,W503 --statistics src/main/python/ddadevops/ mypy: stage: lint&test diff --git a/build.py b/build.py index 7240009..870d56c 100644 --- a/build.py +++ b/build.py @@ -28,7 +28,7 @@ use_plugin("python.distutils") default_task = "publish" name = "ddadevops" -version = "4.0.0-dev66" +version = "4.0.0-dev67" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/src/main/python/ddadevops/application/terraform_service.py b/src/main/python/ddadevops/application/terraform_service.py index 815a62f..fe01938 100644 --- a/src/main/python/ddadevops/application/terraform_service.py +++ b/src/main/python/ddadevops/application/terraform_service.py @@ -76,9 +76,7 @@ class TerraformService: # TODO: internal? def init_client(self, devops: Devops): - terraform_domain = devops.specialized_builds[ - BuildType.TERRAFORM - ] + terraform_domain = devops.specialized_builds[BuildType.TERRAFORM] terraform = Terraform( working_dir=devops.build_path(), terraform_semantic_version=terraform_domain.tf_terraform_semantic_version, diff --git a/src/main/python/ddadevops/domain/provider_hetzner.py b/src/main/python/ddadevops/domain/provider_hetzner.py index a23d602..bb0b786 100644 --- a/src/main/python/ddadevops/domain/provider_hetzner.py +++ b/src/main/python/ddadevops/domain/provider_hetzner.py @@ -15,8 +15,7 @@ class Hetzner(Validateable, CredentialMappingDefault): return result def backend_config(self) -> Dict[str, Any]: - result = {} - return result + return {} def resources_from_package(self) -> Set[str]: return {"provider_registry.tf", "hetzner_provider.tf", "hetzner_mixin_vars.tf"} diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 18edca1..ae8b5ce 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -114,11 +114,11 @@ class ExecutionApi: output = output.rstrip() return output - def execute_live(self, command, dry_run=False): + def execute_live(self, command, dry_run=False, shell=True): if dry_run: print(command) else: - process = Popen(command, stdout=PIPE) + process = Popen(command, stdout=PIPE, shell=shell) for line in iter(process.stdout.readline, b""): print(line.decode("utf-8"), end="") process.stdout.close()