Check if scenario file exists before attempting to load
Useful when running the `create_scenarios` rule the first time.
This commit is contained in:
parent
60fe95ddf7
commit
8b2a068b3a
@ -43,10 +43,11 @@ def get_scenarios(run):
|
|||||||
scenario_config = run.get("scenarios", {})
|
scenario_config = run.get("scenarios", {})
|
||||||
if run["name"] and scenario_config.get("enable"):
|
if run["name"] and scenario_config.get("enable"):
|
||||||
fn = Path(scenario_config["file"])
|
fn = Path(scenario_config["file"])
|
||||||
scenarios = yaml.safe_load(fn.read_text())
|
if fn.exists():
|
||||||
if run["name"] == "all":
|
scenarios = yaml.safe_load(fn.read_text())
|
||||||
run["name"] = list(scenarios.keys())
|
if run["name"] == "all":
|
||||||
return scenarios
|
run["name"] = list(scenarios.keys())
|
||||||
|
return scenarios
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user