Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions reframe/frontend/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,15 @@ def main():
for err in options.update_config(site_config):
printer.warning(str(err))

# Update options from the selected execution mode
if options.mode:
mode_args = site_config.get(f'modes/@{options.mode}/options')

# Parse the mode's options and reparse the command-line
options = argparser.parse_args(mode_args)
options = argparser.parse_args(namespace=options.cmd_options)
options.update_config(site_config)

logging.configure_logging(site_config)
except (OSError, ConfigError) as e:
printer.error(f'failed to load configuration: {e}')
Expand Down Expand Up @@ -447,18 +456,6 @@ def main():
printer.error('could not load module mappings: %s' % e)
sys.exit(1)

if options.mode:
try:
mode_args = rt.get_option(f'modes/@{options.mode}/options')

# Parse the mode's options and reparse the command-line
options = argparser.parse_args(mode_args)
options = argparser.parse_args(namespace=options.cmd_options)
options.update_config(rt.site_config)
except ConfigError as e:
printer.error('could not obtain execution mode: %s' % e)
sys.exit(1)

if (os_ext.samefile(rt.stage_prefix, rt.output_prefix) and
not site_config.get('general/0/keep_stage_files')):
printer.error("stage and output refer to the same directory; "
Expand Down