minor fixes for test image, devops, c4k green

This commit is contained in:
Michael Jerger 2023-05-18 14:12:01 +02:00
parent 57a43085c0
commit d16a022728
2 changed files with 16 additions and 9 deletions

View file

@ -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 = [

View file

@ -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