*: Use action_utils.run instead of subprocess.check_output

- 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:56 +03:00
1 parent bf9005ac48
commit b253166f6d
17 files changed
+101 -72

No files matched your search

+3 -3
View File
@@ -64,10 +64,10 @@ deb http://deb.debian.org/debian trixie main
assert utils.get_sources_list_codename() == 'testing'
@patch('subprocess.check_output')
def test_get_current_release(check_output):
@patch('subprocess.run')
def test_get_current_release(run):
"""Test that getting current release works."""
check_output.return_value = b'test-release\ntest-codename\n\n'
run.return_value.stdout = b'test-release\ntest-codename\n\n'
assert utils.get_current_release() == ('test-release', 'test-codename')