Merge branch 'issue1126' into develop

This commit is contained in:
nicolargo 2017-07-24 08:48:31 +02:00
commit ca563cac7a
2 changed files with 5 additions and 2 deletions

1
NEWS
View File

@ -17,6 +17,7 @@ Bugs corrected:
* GPU plugin. <class 'TypeError'>: ... not JSON serializable"> (issue #1112)
* PermissionError on macOS (issue #1120)
* Cant move up or down in glances --browser (issue #1113)
* Unable to give aliases to or hide network interfaces and disks (issue #1126)
Installation:

View File

@ -722,13 +722,15 @@ class GlancesPlugin(object):
hide=sda2,sda5,loop.*
"""
# TODO: possible optimisation: create a re.compile list
return not all(j is None for j in [re.match(i, value) for i in self.get_conf_value('hide', header=header)])
return not all(j is None for j in [re.match(i, value.lower()) for i in self.get_conf_value('hide', header=header)])
def has_alias(self, header):
"""Return the alias name for the relative header or None if nonexist."""
try:
return self._limits[self.plugin_name + '_' + header + '_' + 'alias'][0]
# Force to lower case (issue #1126)
return self._limits[self.plugin_name + '_' + header.lower() + '_' + 'alias'][0]
except (KeyError, IndexError):
# logger.debug("No alias found for {}".format(header))
return None
def msg_curse(self, args=None, max_width=None):