summaryrefslogtreecommitdiffstats
path: root/glances/outdated.py
diff options
context:
space:
mode:
Diffstat (limited to 'glances/outdated.py')
-rw-r--r--glances/outdated.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/glances/outdated.py b/glances/outdated.py
index 0783afba..023413e2 100644
--- a/glances/outdated.py
+++ b/glances/outdated.py
@@ -27,7 +27,7 @@ try:
PACKAGING_IMPORT = True
except Exception as e:
- logger.error("Unable to import 'packaging' module ({}). Glances cannot check for updates.".format(e))
+ logger.warning("Unable to import 'packaging' module ({}). Glances cannot check for updates.".format(e))
PACKAGING_IMPORT = False
PYPI_API_URL = 'https://pypi.python.org/pypi/Glances/json'
@@ -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 !