upgrades: Get result of start-dist-upgrade

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
James Valleroy authored and Veiko Aasa committed 2021-01-31 22:31:39 +02:00
1 parent 906816f7cb
commit d747f77f80
2 files changed
+14 -2

No files matched your search

+7 -1
View File
@@ -5,6 +5,7 @@ Configures or runs unattended-upgrades
"""
import argparse
import json
import logging
import os
import pathlib
@@ -478,7 +479,6 @@ def subcommand_start_dist_upgrade(arguments):
if updates are enabled.
"""
upgrade_ready, reason = _check_dist_upgrade(arguments.test)
print(reason)
if upgrade_ready:
with open(DIST_UPGRADE_SERVICE_PATH, 'w') as service_file:
service_file.write(DIST_UPGRADE_SERVICE)
@@ -489,6 +489,12 @@ def subcommand_start_dist_upgrade(arguments):
stderr=subprocess.DEVNULL, close_fds=True,
start_new_session=True)
print(
json.dumps({
'dist_upgrade_started': upgrade_ready,
'reason': reason,
}))
def subcommand_dist_upgrade(_):
"""Perform major distribution upgrade.