From 42f53f7e9e31e23f57f0858d5a2ea8ee45bfcf82 Mon Sep 17 00:00:00 2001 From: Raz Crimson <52282402+RazCrimson@users.noreply.github.com> Date: Fri, 24 Feb 2023 00:23:29 +0530 Subject: [PATCH] fix: Outdated - cmdline flag precedence Old Precedence: check_update in conf > --disable-check-update Current Precedence: --disable-check-update > check_update in conf --- glances/outdated.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/glances/outdated.py b/glances/outdated.py index 0783afba..b2b17913 100644 --- a/glances/outdated.py +++ b/glances/outdated.py @@ -49,10 +49,15 @@ class Outdated(object): # Set default value... self.data = {u'installed_version': __version__, u'latest_version': '0.0', u'refresh_date': datetime.now()} - # Read the configuration file - self.load_config(config) + + # Disable update check if `packaging` is not installed if not PACKAGING_IMPORT: self.args.disable_check_update = True + + # Read the configuration file only if update check is not explicitly disabled + if not self.args.disable_check_update: + self.load_config(config) + logger.debug("Check Glances version up-to-date: {}".format(not self.args.disable_check_update)) # And update !