CLI: Make autoupgrade resume operations after finish

This commit is contained in:
deajan 2024-11-26 21:27:09 +01:00
parent 99b7247e6e
commit 6070529cfd
2 changed files with 7 additions and 4 deletions

View file

@ -551,7 +551,8 @@ This is free software, and you are welcome to redistribute it under certain cond
full_config, ignore_errors=False if args.auto_upgrade else True
)
if result:
sys.exit(0)
# This only happens when no upgrade is available
logger.info("Upgrade check finished. Resuming operations.")
elif args.auto_upgrade:
logger.error("Auto upgrade failed")
sys.exit(23)
@ -742,7 +743,9 @@ This is free software, and you are welcome to redistribute it under certain cond
if cli_args["operation"]:
entrypoint(**cli_args)
else:
json_error_logging(False, "No operation has been requested", level="warning")
json_error_logging(False, "No operation has been requested. Try --help", level="warning")
# parser.print_help(sys.stderr)
sys.exit(1)
def main():

View file

@ -7,7 +7,7 @@ __intname__ = "npbackup.upgrade_client.upgrader"
__author__ = "Orsiris de Jong"
__copyright__ = "Copyright (C) 2023-2024 NetInvent"
__license__ = "BSD-3-Clause"
__build__ = "2024112601"
__build__ = "2024112602"
import os
@ -274,4 +274,4 @@ def auto_upgrader(
)
logger.debug(cmd)
deferred_command(cmd, defer_time=UPGRADE_DEFER_TIME)
return True
sys.exit(0)