*: Use action_utils.run instead of subprocess.check_call

- This is to capture stdout and stderr and transmit that from privileged daemon
back to the service to be displayed in HTML.

Tests:

- Unit tests and code checks pass.

- Some of the modified actions work as expected.

- systemd daemon-reload is performed during infinoted setup.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa authored and Veiko Aasa committed 2025-09-29 16:58:54 +03:00
1 parent 61ff15a04f
commit 80e6d940a4
9 files changed
+44 -44

No files matched your search

+1 -2
View File
@@ -7,7 +7,6 @@ import pathlib
import pwd
import shutil
import stat
import subprocess
import augeas
@@ -101,7 +100,7 @@ def set_keys(user: str, keys: str, auth_user: str, auth_password: secret_str):
ssh_folder = os.path.join(get_user_homedir(user), '.ssh')
key_file_path = os.path.join(ssh_folder, 'authorized_keys')
subprocess.check_call(['mkhomedir_helper', user])
action_utils.run(['mkhomedir_helper', user], check=True)
if not os.path.exists(ssh_folder):
os.makedirs(ssh_folder)