Skip to content

Commit

Permalink
Validate (and update) arguments before interpolating them into recipes (
Browse files Browse the repository at this point in the history
  • Loading branch information
Onager authored Jun 11, 2024
1 parent c4fdf13 commit 2be184c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dftimewolf/cli/dftimewolf_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,6 @@ def RunTool(cdm: Optional[CursesDisplayManager] = None) -> int:
'core',
recipe_name)

# Interpolate arguments into recipe
recipe = tool.state.recipe
for module in recipe.get('preflights', []) + recipe.get('modules', []):
module['args'] = utils.ImportArgsFromDict(module['args'],
tool.state.command_line_options,
tool.state.config)

try:
tool.ValidateArguments()
except errors.CriticalError as exception:
Expand All @@ -533,6 +526,13 @@ def RunTool(cdm: Optional[CursesDisplayManager] = None) -> int:
logger.critical(str(exception))
return 1

# Interpolate arguments into recipe
recipe = tool.state.recipe
for module in recipe.get('preflights', []) + recipe.get('modules', []):
module['args'] = utils.ImportArgsFromDict(module['args'],
tool.state.command_line_options,
tool.state.config)

tool.state.LogExecutionPlan()

if tool.dry_run:
Expand Down

0 comments on commit 2be184c

Please sign in to comment.