Skip to content

Commit 510329e

Browse files
committed
scenarios: get -- --help before using any helm or k8s commands
1 parent 58c8204 commit 510329e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/warnet/control.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ def run(scenario_file: str, additional_args: tuple[str]):
169169
scenario_path = Path(scenario_file).resolve()
170170
scenario_name = scenario_path.stem
171171

172+
if additional_args and ("--help" in additional_args or "-h" in additional_args):
173+
return subprocess.run([sys.executable, scenario_path, "--help"])
174+
172175
with open(scenario_path, "rb") as file:
173176
scenario_data = base64.b64encode(file.read()).decode()
174177

@@ -210,8 +213,6 @@ def run(scenario_file: str, additional_args: tuple[str]):
210213
# Add additional arguments
211214
if additional_args:
212215
helm_command.extend(["--set", f"args={' '.join(additional_args)}"])
213-
if "--help" in additional_args or "-h" in additional_args:
214-
return subprocess.run([sys.executable, scenario_path, "--help"])
215216

216217
helm_command.extend([name, COMMANDER_CHART])
217218

0 commit comments

Comments
 (0)