Skip to content
Snippets Groups Projects
Commit a39e2342 authored by Felix Tomski's avatar Felix Tomski
Browse files

Fix installer with downscope disabled

parent ff045057
Branches
No related tags found
No related merge requests found
......@@ -186,7 +186,7 @@ def CLI():
parser = argparse.ArgumentParser(prog='Aixcellenz CI Driver Installer')
add_parameters(parser, parameters['global'])
subparsers = parser.add_subparsers(help='sub-command help')
subparsers = parser.add_subparsers(dest='cmd_name', help='sub-command help')
for cmd in subcommands:
subcmd_parser = subparsers.add_parser(cmd, help=f'{cmd} help', aliases=subcommands[cmd]['aliases'])
......@@ -200,10 +200,14 @@ def CLI():
args_to_expand = ['runner_install_path', 'shell_installation', 'mapping_path',
'public_key_path', 'key_path', 'log_path', 'rt_utility_path']
for arg in args_to_expand:
try:
vars(ret)[arg] = os.path.expandvars(os.path.expanduser(vars(ret)[arg]))
if not os.path.isabs(vars(ret)[arg]):
vars(ret)[arg] = os.path.join(ret.install_path, vars(ret)[arg])
except KeyError as _:
pass
if ret.cmd_name == 'install':
ret.shell_file = os.path.expandvars(os.path.expanduser(ret.shell_file))
if not os.path.isabs(ret.shell_file):
ret.shell_file = os.path.join(ret.rt_utility_path, ret.shell_file)
......@@ -275,6 +279,7 @@ def install():
with open(args.shell_file, "a") as shell_fp:
shell_fp.writelines(f"export PATH=$PATH:{_runner_install_path}\n")
if args.downscope:
set_utility_permissions(_runner_install_path, ['gitlab-runner'])
set_utility_permissions(args.rt_utility_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment