fix: Outdated - cmdline flag precedence

Old Precedence:
check_update in conf > --disable-check-update

Current Precedence:
--disable-check-update > check_update in conf
This commit is contained in:
Raz Crimson 2023-02-24 00:23:29 +05:30
parent 91b086b134
commit 42f53f7e9e

View File

@ -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 !