Added orchestration.Server remote status retrieval

This commit is contained in:
Marc Aymerich 2016-02-04 12:15:48 +00:00
parent 5565426b59
commit d23ccd38fa
1 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ def retrieve_state(servers):
if ping.startswith('rtt'): if ping.startswith('rtt'):
ping = '%s ms' % ping.split('/')[4] ping = '%s ms' % ping.split('/')[4]
else: else:
ping = '<span style="color:red"><b>Offline<b></span>' ping = '<span style="color:red">Offline</span>'
uptime = join(uptime, silent=True) uptime = join(uptime, silent=True)
uptime_stderr = uptime.stderr.decode() uptime_stderr = uptime.stderr.decode()
@ -26,7 +26,7 @@ def retrieve_state(servers):
if uptime: if uptime:
uptime = 'Up %s %s load %s %s %s' % (uptime[2], uptime[3], uptime[-3], uptime[-2], uptime[-1]) uptime = 'Up %s %s load %s %s %s' % (uptime[2], uptime[3], uptime[-3], uptime[-2], uptime[-1])
else: else:
uptime = '<span style="color:red"><b>%s<b></span>' % uptime_stderr uptime = '<span style="color:red">%s</span>' % uptime_stderr
state[server.pk] = (ping, uptime) state[server.pk] = (ping, uptime)
return state return state