Skip to content

Commit 076346d

Browse files
committed
scenarios: get -- --help before using any helm or k8s commands
1 parent 8ac9219 commit 076346d

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
@@ -178,6 +178,9 @@ def run(scenario_file: str, debug: bool, additional_args: tuple[str]):
178178
scenario_path = Path(scenario_file).resolve()
179179
scenario_name = scenario_path.stem
180180

181+
if additional_args and ("--help" in additional_args or "-h" in additional_args):
182+
return subprocess.run([sys.executable, scenario_path, "--help"])
183+
181184
with open(scenario_path, "rb") as file:
182185
scenario_data = base64.b64encode(file.read()).decode()
183186

@@ -219,8 +222,6 @@ def run(scenario_file: str, debug: bool, additional_args: tuple[str]):
219222
# Add additional arguments
220223
if additional_args:
221224
helm_command.extend(["--set", f"args={' '.join(additional_args)}"])
222-
if "--help" in additional_args or "-h" in additional_args:
223-
return subprocess.run([sys.executable, scenario_path, "--help"])
224225

225226
helm_command.extend([name, COMMANDER_CHART])
226227

0 commit comments

Comments
 (0)