Skip to content

Commit e578ab2

Browse files
authored
feat: change default isolation mode from 'restrictive' to 'cfg' (#345)
- Update default isolation mode to 'cfg' in arg_parser.py - Update test cases to explicitly use 'restrictive' mode where needed - This makes the cfg isolation mode the default behavior for better workspace isolation
1 parent f87e5d3 commit e578ab2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ansible_dev_environment/arg_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def parse() -> argparse.Namespace:
260260
" cfg: Update or add an ansible.cfg file in the current working directory to isolate the workspace"
261261
" none: No isolation, not recommended."
262262
),
263-
default="restrictive",
263+
default="cfg",
264264
choices=["restrictive", "cfg", "none"],
265265
type=str,
266266
)

tests/unit/test_cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def test_acp_env_var_set(
140140
monkeypatch: Pytest fixture.
141141
"""
142142
monkeypatch.setenv(env_var, "test")
143-
monkeypatch.setattr("sys.argv", ["ansible-dev-environment", "install"])
143+
monkeypatch.setattr("sys.argv", ["ansible-dev-environment", "install", "--im", "restrictive"])
144144
with pytest.raises(SystemExit):
145145
main(dry=True)
146146
captured = capsys.readouterr()
@@ -162,7 +162,7 @@ def test_collections_in_home(
162162
"""
163163
monkeypatch.setattr(
164164
"sys.argv",
165-
["ansible-dev-environment", "install", "--venv", "venv"],
165+
["ansible-dev-environment", "install", "--venv", "venv", "--im", "restrictive"],
166166
)
167167
monkeypatch.setenv("HOME", str(tmp_path))
168168
monkeypatch.setenv("ANSIBLE_HOME", str(tmp_path / ".ansible"))
@@ -222,7 +222,7 @@ def _iterdir(path: Path) -> list[Path] | Generator[Path, None, None]:
222222

223223
monkeypatch.setattr(
224224
"sys.argv",
225-
["ansible-dev-environment", "install", "--venv", "venv"],
225+
["ansible-dev-environment", "install", "--venv", "venv", "--im", "restrictive"],
226226
)
227227
with pytest.raises(SystemExit):
228228
main(dry=True)

0 commit comments

Comments
 (0)