mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
*: 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:
1 parent
61ff15a04f
commit
80e6d940a4
9 files changed
+44
-44
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user