Correct two issues with latest Zeroconf version (issue #888 and #889)

This commit is contained in:
nicolargo 2016-07-15 17:39:43 +02:00
parent 2b872959ed
commit d5d85325dd
4 changed files with 11 additions and 6 deletions

4
NEWS
View File

@ -38,7 +38,9 @@ Bugs corrected:
* On Windows, Glances try to display unexisting Load stats (issue #871)
* Check CPU info (issue #881)
* Unicode error on processlist on Windows server 2008 (french) (issue #886)
* PermissionError/OSError when starting glances (issue #885)
* PermissionError/OSError when starting glances (issue #885)
* Zeroconf problem with zeroconf_type = "_%s._tcp." % __appname__ (issue #888)
* Zeroconf problem with zeroconf service name (issue #889)
* Top 3 processes are back in the alert summary
Code quality follow up: from 5.93 to 6.24 (source: https://scrutinizer-ci.com/g/nicolargo/glances)

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
@ -47,7 +47,9 @@ if zeroconf_tag:
sys.exit(1)
# Global var
zeroconf_type = "_%s._tcp." % __appname__
# Recent versions of the zeroconf python package doesnt like a zeroconf type that ends with '._tcp.'.
# Correct issue: zeroconf problem with zeroconf_type = "_%s._tcp." % __appname__ #888
zeroconf_type = "_%s._tcp.local." % __appname__
class AutoDiscovered(object):

View File

@ -104,7 +104,7 @@ class _GlancesCurses(object):
def load_config(self, config):
'''Load the outputs section of the configuration file'''
# Load the theme
if config.has_section('outputs'):
if config is not None and config.has_section('outputs'):
logger.debug('Read the outputs section in the configuration file')
self.theme['name'] = config.get_value('outputs', 'curse_theme', default='black')
logger.debug('Theme for the curse interface: {}'.format(self.theme['name']))

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
@ -207,7 +207,8 @@ class GlancesServer(object):
if not self.args.disable_autodiscover:
# Note: The Zeroconf service name will be based on the hostname
self.autodiscover_client = GlancesAutoDiscoverClient(socket.gethostname(), args)
# Correct issue: Zeroconf problem with zeroconf service name #889
self.autodiscover_client = GlancesAutoDiscoverClient(socket.gethostname().split('.', 1)[0], args)
else:
logger.info("Glances autodiscover announce is disabled")