upgrades: Cleanup use of return value from _apt_run

_apt_run does not return anything.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Update test case]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
James Valleroy 2025-04-07 21:02:52 -04:00 committed by Sunil Mohan Adapa
parent 97cc901fe6
commit e4586eeb72
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 1 additions and 9 deletions

View File

@ -338,11 +338,7 @@ def _apt_autoremove():
def _apt_full_upgrade():
"""Run and check if apt upgrade was successful."""
logger.info('Running apt full-upgrade...')
returncode = _apt_run(['full-upgrade'])
if returncode:
raise RuntimeError(
'Apt full-upgrade was not successful. Distribution upgrade '
'will be retried at a later time.')
_apt_run(['full-upgrade'])
def _unattended_upgrades_run():

View File

@ -396,10 +396,6 @@ def test_apt_full_upgrade(apt_run):
distupgrade._apt_full_upgrade()
apt_run.assert_called_with(['full-upgrade'])
apt_run.return_value = 1
with pytest.raises(RuntimeError):
distupgrade._apt_full_upgrade()
@patch('subprocess.run')
def test_unatteneded_upgrades_run(run):