Skip to content

Commit

Permalink
Change except in Zeroconf
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolargo committed Jun 20, 2021
1 parent 4873f06 commit 26ce4e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions glances/autodiscover.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ def __init__(self, hostname, args=None):
# address (only one address) is replaced by addresses (list of addresses)
self.info = ServiceInfo(
zeroconf_type,
'{}:{}.{}'.format(hostname,
args.port,
zeroconf_type),
name = '{}:{}.{}'.format(hostname,
args.port,
zeroconf_type),
addresses=[socket.inet_pton(address_family, zeroconf_bind_address)],
port=args.port,
weight=0,
Expand All @@ -237,7 +237,7 @@ def __init__(self, hostname, args=None):
server=hostname)
try:
self.zeroconf.register_service(self.info)
except socket.error as e:
except Exception as e:
logger.error("Error while announcing Glances server: {}".format(e))
else:
print("Announce the Glances server on the LAN (using {} IP address)".format(zeroconf_bind_address))
Expand Down

0 comments on commit 26ce4e5

Please sign in to comment.