Skip to content

Commit 73595d0

Browse files
committed
Disable default credentials save
1 parent d326cef commit 73595d0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

archinstall/lib/configuration.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,13 @@ def save_user_creds(self, dest_path: Path) -> None:
105105
target.write_text(self.user_credentials_to_json())
106106
target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP)
107107

108-
def save(self, dest_path: Path | None = None) -> None:
108+
def save(self, dest_path: Path | None = None, creds: bool = False) -> None:
109109
save_path = dest_path or self._default_save_path
110110

111111
if self._is_valid_path(save_path):
112112
self.save_user_config(save_path)
113-
self.save_user_creds(save_path)
113+
if creds:
114+
self.save_user_creds(save_path)
114115

115116

116117
def save_config(config: ArchConfig) -> None:
@@ -206,4 +207,4 @@ def preview(item: MenuItem) -> str | None:
206207
case "user_creds":
207208
config_output.save_user_creds(dest_path)
208209
case "all":
209-
config_output.save(dest_path)
210+
config_output.save(dest_path, creds=True)

tests/test_configuration_output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_creds_roundtrip(
6060
test_out_dir = Path('/tmp/')
6161
test_out_file = test_out_dir / config_output.user_credentials_file
6262

63-
config_output.save(test_out_dir)
63+
config_output.save(test_out_dir, creds=True)
6464

6565
result = json.loads(test_out_file.read_text())
6666
expected = json.loads(creds_fixture.read_text())

0 commit comments

Comments
 (0)