summaryrefslogtreecommitdiffstats
path: root/glances/autodiscover.py
diff options
context:
space:
mode:
authorAlessio Sergi <al3hex@gmail.com>2016-06-02 20:02:26 +0200
committerAlessio Sergi <al3hex@gmail.com>2016-06-02 20:04:13 +0200
commitcb27f0c7344760afa03c4994ddae96a727253558 (patch)
treea08b46f983173875fbd1fbb141f00eeff843e57b /glances/autodiscover.py
parent28eb3f6817f04b4cfc83e5ab0c4cff53204447a5 (diff)
No more Python 2.6 compatible string.format calls
Diffstat (limited to 'glances/autodiscover.py')
-rw-r--r--glances/autodiscover.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/glances/autodiscover.py b/glances/autodiscover.py
index 23486000..e7c9de45 100644
--- a/glances/autodiscover.py
+++ b/glances/autodiscover.py
@@ -41,7 +41,7 @@ except ImportError:
if zeroconf_tag:
zeroconf_min_version = (0, 17, 0)
zeroconf_version = tuple([int(num) for num in __zeroconf_version.split('.')])
- logger.debug("Zeroconf version {0} detected.".format(__zeroconf_version))
+ logger.debug("Zeroconf version {} detected.".format(__zeroconf_version))
if zeroconf_version < zeroconf_min_version:
logger.critical("Please install zeroconf 0.17 or higher.")
sys.exit(1)
@@ -191,7 +191,7 @@ class GlancesAutoDiscoverClient(object):
try:
self.zeroconf = Zeroconf()
except socket.error as e:
- logger.error("Cannot start zeroconf: {0}".format(e))
+ logger.error("Cannot start zeroconf: {}".format(e))
# XXX *BSDs: Segmentation fault (core dumped)
# -- https://bitbucket.org/al45tair/netifaces/issues/15
@@ -205,15 +205,15 @@ class GlancesAutoDiscoverClient(object):
pass
self.info = ServiceInfo(
- zeroconf_type, '{0}:{1}.{2}'.format(hostname, args.port, zeroconf_type),
+ zeroconf_type, '{}:{}.{}'.format(hostname, args.port, zeroconf_type),
address=socket.inet_aton(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:
- logger.error("Error while announcing Glances server: {0}".format(e))
+ logger.error("Error while announcing Glances server: {}".format(e))
else:
- print("Announce the Glances server on the LAN (using {0} IP address)".format(zeroconf_bind_address))
+ print("Announce the Glances server on the LAN (using {} IP address)".format(zeroconf_bind_address))
else:
logger.error("Cannot announce Glances server on the network: zeroconf library not found.")