mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-21 08:11:39 +03:00
Merge branch 'issue1663' into develop
This commit is contained in:
commit
4b7681a1ce
@ -209,10 +209,23 @@ class GlancesAutoDiscoverClient(object):
|
||||
address_family = socket.getaddrinfo(zeroconf_bind_address, args.port)[0][0]
|
||||
|
||||
# Start the zeroconf service
|
||||
try:
|
||||
self.info = ServiceInfo(
|
||||
zeroconf_type, '{}:{}.{}'.format(hostname, args.port, zeroconf_type),
|
||||
address=socket.inet_pton(address_family, zeroconf_bind_address),
|
||||
zeroconf_type, '{}:{}.{}'.format(
|
||||
hostname, args.port, zeroconf_type),
|
||||
address=socket.inet_pton(
|
||||
address_family, zeroconf_bind_address),
|
||||
port=args.port, weight=0, priority=0, properties={}, server=hostname)
|
||||
except TypeError:
|
||||
# Manage issue 1663 with breaking change on ServiceInfo method
|
||||
# address (only one address) is replaced by addresses (list of addresses)
|
||||
self.info = ServiceInfo(
|
||||
zeroconf_type, '{}:{}.{}'.format(
|
||||
hostname, args.port, zeroconf_type),
|
||||
addresses=[socket.inet_pton(
|
||||
address_family, zeroconf_bind_address)],
|
||||
port=args.port, weight=0, priority=0, properties={}, server=hostname)
|
||||
|
||||
try:
|
||||
self.zeroconf.register_service(self.info)
|
||||
except socket.error as e:
|
||||
|
@ -25,4 +25,4 @@ sparklines
|
||||
statsd
|
||||
wifi
|
||||
zeroconf==0.19.1; python_version < "3.0"
|
||||
zeroconf; python_version >= "3.0"
|
||||
zeroconf>=0.28; python_version >= "3.0"
|
||||
|
Loading…
Reference in New Issue
Block a user