*: Use action_utils.run instead of subprocess.run

- 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.

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:53 +03:00
1 parent 355812c9f2
commit 61ff15a04f
36 files changed
+257 -244

No files matched your search

+3 -3
View File
@@ -115,7 +115,7 @@ def revoke(domain: str):
if TEST_MODE:
command.append('--staging')
subprocess.run(command, check=True)
action_utils.run(command, check=True)
action_utils.webserver_disable(domain, kind='site')
@@ -132,7 +132,7 @@ def obtain(domain: str):
if TEST_MODE:
command.append('--staging')
subprocess.run(command, check=True)
action_utils.run(command, check=True)
@privileged
@@ -249,5 +249,5 @@ def _assert_managed_path(module, path):
def delete(domain: str):
"""Disable a domain and delete the certificate."""
command = ['certbot', 'delete', '--non-interactive', '--cert-name', domain]
subprocess.run(command, check=True)
action_utils.run(command, check=True)
action_utils.webserver_disable(domain, kind='site')