From 50af5a9e4dbe7da153abfb23246b054666c2945c Mon Sep 17 00:00:00 2001 From: Fredrik Eriksson Date: Sun, 7 Apr 2019 19:27:15 +0200 Subject: [PATCH] added option to disable system- and package upgrade as well as service restart --- bin/sau | 15 ++++++++++++--- config.cfg | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bin/sau b/bin/sau index 8f6f37d..6a0605f 100755 --- a/bin/sau +++ b/bin/sau @@ -16,10 +16,19 @@ def main(): conf = sau.config log = logging.getLogger(sau.LOGNAME) platform = sau.platforms.get_platform() - reboot_required = platform.system_upgrade() - platform.pkg_upgrade() - reboot_recommended = sau.services.restart_services() + reboot_required = False + reboot_recommended = False + + if conf.getboolean('default', 'do_system_upgrade', fallback=True): + reboot_required = platform.system_upgrade() + + if conf.getboolean('default', 'do_package_upgrade', fallback=True): + platform.pkg_upgrade() + + if conf.getboolean('default', 'do_service_restart', fallback=True): + reboot_recommended = sau.services.restart_services() + if conf.getboolean('default', 'do_reboot', fallback=False): if reboot_required: log.warning('Rebooting because of a system upgrade') diff --git a/config.cfg b/config.cfg index 84daa64..c3b1843 100644 --- a/config.cfg +++ b/config.cfg @@ -16,6 +16,10 @@ min_version_diff=2 # not close all deleted files (any platform) do_reboot=no +do_system_upgrade=yes +do_package_upgrade=yes +do_service_restart=yes + # The packages section contains = pairs to override the # default min_version_diff. Note that package naming may differ depending on