global: refactor to use config.{file,runtime}.$member instead of config.file["$member"]
This commit is contained in:
parent
13ad63446e
commit
bef0efc637
15 changed files with 65 additions and 54 deletions
|
@ -15,7 +15,7 @@ wrapper_impls: dict[str, Wrapper] = {
|
|||
|
||||
|
||||
def get_wrapper_type(wrapper_type: str = None):
|
||||
return wrapper_type or config.file['wrapper']['type']
|
||||
return wrapper_type or config.file.wrapper.type
|
||||
|
||||
|
||||
def get_wrapper_impl(wrapper_type: str = None) -> Wrapper:
|
||||
|
@ -34,7 +34,7 @@ def is_wrapped(wrapper_type: str = None):
|
|||
|
||||
def enforce_wrap(no_wrapper=False):
|
||||
wrapper_type = get_wrapper_type()
|
||||
if wrapper_type != 'none' and not is_wrapped(wrapper_type) and not config.runtime['no_wrap'] and not no_wrapper:
|
||||
if wrapper_type != 'none' and not is_wrapped(wrapper_type) and not config.runtime.no_wrap and not no_wrapper:
|
||||
logging.info(f'Wrapping in {wrapper_type}')
|
||||
wrap()
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class DockerWrapper(BaseWrapper):
|
|||
type: str = 'docker'
|
||||
|
||||
def wrap(self):
|
||||
script_path = config.runtime['script_source_dir']
|
||||
script_path = config.runtime.script_source_dir
|
||||
with open(os.path.join(script_path, 'version.txt')) as version_file:
|
||||
version = version_file.read().replace('\n', '')
|
||||
tag = f'registry.gitlab.com/kupfer/kupferbootstrap:{version}'
|
||||
|
@ -34,7 +34,7 @@ class DockerWrapper(BaseWrapper):
|
|||
'.',
|
||||
'-t',
|
||||
tag,
|
||||
] + (['-q'] if not config.runtime['verbose'] else [])
|
||||
] + (['-q'] if not config.runtime.verbose else [])
|
||||
logging.debug('Running docker cmd: ' + ' '.join(cmd))
|
||||
result = subprocess.run(cmd, cwd=script_path, capture_output=True)
|
||||
if result.returncode != 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue