diff --git a/src/main/python/ddadevops/domain/init_service.py b/src/main/python/ddadevops/domain/init_service.py index 3d2efa3..d15ec34 100644 --- a/src/main/python/ddadevops/domain/init_service.py +++ b/src/main/python/ddadevops/domain/init_service.py @@ -32,6 +32,7 @@ class InitService: mixin_types = self.devops_factory.__parse_mixin_types__(input["mixin_types"]) version = None + default_mappings = [] if BuildType.C4K in build_types: default_mappings = [ diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 95773ee..7f69e56 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -4,13 +4,16 @@ from os import chmod from subprocess import run from pkg_resources import resource_string import yaml +from os import environ import deprecation from ..domain import Devops, Image, C4k, Release, BuildFile from ..python_util import execute + class ProjectRepository: pass + class ResourceApi: def read_resource(self, path: str) -> bytes: return resource_string(__name__, path) @@ -100,25 +103,28 @@ class ExecutionApi: print(output) return output -class EnvironmentApi(): + +class EnvironmentApi: def get(self, key): return environ.get(key) -class CredentialsApi(): - def __init__ (self): +class CredentialsApi: + def __init__(self): self.execution_api = ExecutionApi() - def gopass_field_from_path (self, path, field): + def gopass_field_from_path(self, path, field): credential = None if path and field: - print('get field for: ' + path + ', ' + field) - credential = self.execution_api.execute(['gopass', 'show', path, field]) + print("get field for: " + path + ", " + field) + credential = self.execution_api.execute(["gopass", "show", path, field]) return credential - def gopass_password_from_path (elf, path): + def gopass_password_from_path(self, path): credential = None if path: - print('get password for: ' + path) - credential = self.execution_api.execute(['gopass', 'show', '--password', path]) + print("get password for: " + path) + credential = self.execution_api.execute( + ["gopass", "show", "--password", path] + ) return credential