Glances stopped working when using VPN with no internet access. #842

This commit is contained in:
Nicolargo 2016-04-04 16:24:20 +02:00
parent e4c3cffbdb
commit ff613348eb
2 changed files with 7 additions and 2 deletions

1
NEWS
View File

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

View File

@ -2,7 +2,7 @@
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
# Copyright (C) 2016 Nicolargo <nicolas@nicolargo.com>
#
# 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'))