Skip to content

Commit becd396

Browse files
author
Vasileios Karakasis
authored
Merge pull request #1399 from vkarak/bugfix/perflog-exec-modes
[bugfix] Process execution modes before configuring logging
2 parents 5115365 + 7430d18 commit becd396

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

reframe/frontend/cli.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,15 @@ def main():
418418
for err in options.update_config(site_config):
419419
printer.warning(str(err))
420420

421+
# Update options from the selected execution mode
422+
if options.mode:
423+
mode_args = site_config.get(f'modes/@{options.mode}/options')
424+
425+
# Parse the mode's options and reparse the command-line
426+
options = argparser.parse_args(mode_args)
427+
options = argparser.parse_args(namespace=options.cmd_options)
428+
options.update_config(site_config)
429+
421430
logging.configure_logging(site_config)
422431
except (OSError, ConfigError) as e:
423432
printer.error(f'failed to load configuration: {e}')
@@ -447,18 +456,6 @@ def main():
447456
printer.error('could not load module mappings: %s' % e)
448457
sys.exit(1)
449458

450-
if options.mode:
451-
try:
452-
mode_args = rt.get_option(f'modes/@{options.mode}/options')
453-
454-
# Parse the mode's options and reparse the command-line
455-
options = argparser.parse_args(mode_args)
456-
options = argparser.parse_args(namespace=options.cmd_options)
457-
options.update_config(rt.site_config)
458-
except ConfigError as e:
459-
printer.error('could not obtain execution mode: %s' % e)
460-
sys.exit(1)
461-
462459
if (os_ext.samefile(rt.stage_prefix, rt.output_prefix) and
463460
not site_config.get('general/0/keep_stage_files')):
464461
printer.error("stage and output refer to the same directory; "

0 commit comments

Comments
 (0)