Add time sleep between server start and server announce

This commit is contained in:
Nicolas Hennion 2014-11-04 17:38:57 +01:00
parent d902730b5d
commit 1e63e23e77
3 changed files with 7 additions and 5 deletions

View File

@ -102,7 +102,7 @@ class GlancesClientBrowser(object):
logger.warning(
_("Can not grab stats form {0}: {1}").format(uri, e))
except RuntimeError:
logger.debug(_("Server list dictionnary chenge inside the loop (wait next update)"))
logger.debug(_("Server list dictionnary change inside the loop (wait next update)"))
# Update the screen
self.screen.update_browser(self.get_servers_list())

View File

@ -23,6 +23,7 @@
import json
import socket
import sys
import time
from base64 import b64decode
try:
from xmlrpc.server import SimpleXMLRPCRequestHandler
@ -215,7 +216,8 @@ class GlancesServer(object):
self.server.register_introspection_functions()
self.server.register_instance(GlancesInstance(cached_time, config))
# Announce the server to the network
# Announce the server to the network (wait 1 seond before do this)
time.sleep(1)
if not self.args.disable_autodiscover:
# Note: The Zeroconf service name will be based on the hostname
self.autodiscover_client = GlancesAutoDiscoverClient(socket.gethostname(), args)

View File

@ -111,13 +111,13 @@ class Plugin(GlancesPlugin):
self.stats['os_name'] = self.stats['system_name']
# Windows OS tips
if self.get_short_system_name() == 'windows':
for r,v in snmp_to_human['windows'].iteritems():
for r, v in snmp_to_human['windows'].iteritems():
if re.search(r, self.stats['system_name']):
self.stats['os_name'] = v
self.stats['os_name'] = v
break
# Add human readable name
self.stats['hr_name'] = self.stats['os_name']
return self.stats
def msg_curse(self, args=None):