diff --git a/NEWS b/NEWS index ace8e881..c03e33a3 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Bugs corrected: * Crash on launch when viewing temperature of laptop HDD in sleep mode (issue #824) * [Web UI] Fix folders plugin never displayed (issue #829) + * Correct issue IP plugin: VPN with no internet access (issue #842) Version 2.6.1 ============= diff --git a/glances/plugins/glances_ip.py b/glances/plugins/glances_ip.py index caba75b8..99bab71e 100644 --- a/glances/plugins/glances_ip.py +++ b/glances/plugins/glances_ip.py @@ -2,7 +2,7 @@ # # This file is part of Glances. # -# Copyright (C) 2015 Nicolargo +# Copyright (C) 2016 Nicolargo # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -132,8 +132,12 @@ class Plugin(GlancesPlugin): ret.append(self.curse_add_line(msg)) msg = 'IP ' ret.append(self.curse_add_line(msg, 'TITLE')) - msg = '{0:}/{1}'.format(self.stats['address'], self.stats['mask_cidr']) + msg = '{0:}'.format(self.stats['address']) ret.append(self.curse_add_line(msg)) + if 'mask_cidr' in self.stats: + # VPN with no internet access (issue #842) + msg = '/{0}'.format(self.stats['mask_cidr']) + ret.append(self.curse_add_line(msg)) if self.stats['public_address'] is not None: msg = ' Pub ' ret.append(self.curse_add_line(msg, 'TITLE'))