MCPcopy Create free account
hub / github.com/archlinux/archinstall / save_user_creds

Method save_user_creds

archinstall/lib/args.py:428–444  ·  view source on GitHub ↗
(
		self,
		dest_path: Path,
		password: str | None = None,
	)

Source from the content-addressed store, hash-verified

426 target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP)
427
428 def save_user_creds(
429 self,
430 dest_path: Path,
431 password: str | None = None,
432 ) -> None:
433 if not is_valid_path(dest_path):
434 error(f'Invalid path {dest_path}. User credentials could not be saved.')
435 return
436
437 data = self.user_credentials_to_json()
438
439 if password:
440 data = encrypt(password, data)
441
442 target = dest_path / USER_CREDS_FILE
443 target.write_text(data)
444 target.chmod(stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP)
445
446 def as_summary(self) -> str:
447 """

Callers 2

saveMethod · 0.95
save_configFunction · 0.80

Calls 4

is_valid_pathFunction · 0.90
errorFunction · 0.90
encryptFunction · 0.90

Tested by

no test coverage detected