Skip to content
Snippets Groups Projects
Commit 80c96833 authored by Damian Alvarez's avatar Damian Alvarez
Browse files

To make the default work

parent 20a04626
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@ logging.basicConfig(
LOGGER = logging.getLogger('setacls')
config_file = 'acls.yml'
config_path = f'{os.getenv("FASTDATA_jsc")}/swmanage/EasyBuild/{os.getenv("STAGE")}/{config_file})'
config_path = f'{os.getenv("FASTDATA_jsc")}/swmanage/EasyBuild/{os.getenv("STAGE")}/{config_file}'
executed_cmds = 0
......@@ -299,7 +299,11 @@ def run():
# The syntax commented below is more convenient, but just works with PyYAML >5.1
# l_config = yaml.load(args.config[0], Loader=yaml.FullLoader)
with open(args.config[0].name) as config:
if isinstance(args.config, list):
config_file_path = args.config[0].name
else:
config_file_path = args.config.name
with open(config_file_path) as config:
l_config = yaml.safe_load(config)
log_file = '<stderr>'
......@@ -316,7 +320,7 @@ def run():
if args.debug:
LOGGER.setLevel(logging.DEBUG)
LOGGER.debug(f'{bcolors.HEADER}{bcolors.UNDERLINE}Configuration:{bcolors.ENDC}')
LOGGER.debug(f'* {bcolors.CYAN}Config file:{bcolors.ENDC} {args.config[0].name}')
LOGGER.debug(f'* {bcolors.CYAN}Config file:{bcolors.ENDC} {config_file_path}')
LOGGER.debug(f'* {bcolors.CYAN}Debug:{bcolors.ENDC} {args.debug}')
LOGGER.debug(f'* {bcolors.CYAN}Log file:{bcolors.ENDC} {log_file}')
LOGGER.debug(f'* {bcolors.CYAN}Check:{bcolors.ENDC} {args.check}')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment