Skip to content

Commit 76cd883

Browse files
committed
Preserve non-dry-run mount init rejection unless execute is explicit
1 parent 2740715 commit 76cd883

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sourceosctl/commands/agent_machine.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ def mounts_init(args) -> int:
297297
execute = bool(getattr(args, "execute", False))
298298
policy_ok = bool(getattr(args, "policy_ok", False))
299299

300+
if getattr(args, "dry_run", True) is False and not execute:
301+
print("error: non-dry-run mount initialization requires --execute", file=sys.stderr)
302+
return 1
303+
300304
plan = _build_mount_plan(args)
301305
plan["operation"] = "init"
302306
errors = _validate_mount_plan(plan)

0 commit comments

Comments
 (0)