mirror of
https://github.com/nicolargo/glances.git
synced 2025-01-08 19:18:11 +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]
|
address_family = socket.getaddrinfo(zeroconf_bind_address, args.port)[0][0]
|
||||||
|
|
||||||
# Start the zeroconf service
|
# Start the zeroconf service
|
||||||
|
try:
|
||||||
self.info = ServiceInfo(
|
self.info = ServiceInfo(
|
||||||
zeroconf_type, '{}:{}.{}'.format(hostname, args.port, zeroconf_type),
|
zeroconf_type, '{}:{}.{}'.format(
|
||||||
address=socket.inet_pton(address_family, zeroconf_bind_address),
|
hostname, args.port, zeroconf_type),
|
||||||
|
address=socket.inet_pton(
|
||||||
|
address_family, zeroconf_bind_address),
|
||||||
port=args.port, weight=0, priority=0, properties={}, server=hostname)
|
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:
|
try:
|
||||||
self.zeroconf.register_service(self.info)
|
self.zeroconf.register_service(self.info)
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
|
@ -25,4 +25,4 @@ sparklines
|
|||||||
statsd
|
statsd
|
||||||
wifi
|
wifi
|
||||||
zeroconf==0.19.1; python_version < "3.0"
|
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