mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-30 04:32:00 +03:00
Merge pull request #1571 from qubidt/develop
Fix broken method call when config is None
This commit is contained in:
commit
d7a39721f8
@ -117,9 +117,10 @@ class Plugin(GlancesPlugin):
|
||||
self.pid_max = glances_processes.pid_max
|
||||
|
||||
# Set the default sort key if it is defined in the configuration file
|
||||
if 'processlist' in config.as_dict() and 'sort_key' in config.as_dict()['processlist']:
|
||||
logger.debug('Configuration overwrites processes sort key by {}'.format(config.as_dict()['processlist']['sort_key']))
|
||||
glances_processes.set_sort_key(config.as_dict()['processlist']['sort_key'], False)
|
||||
if config is not None:
|
||||
if 'processlist' in config.as_dict() and 'sort_key' in config.as_dict()['processlist']:
|
||||
logger.debug('Configuration overwrites processes sort key by {}'.format(config.as_dict()['processlist']['sort_key']))
|
||||
glances_processes.set_sort_key(config.as_dict()['processlist']['sort_key'], False)
|
||||
|
||||
# Note: 'glances_processes' is already init in the processes.py script
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user