mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
service monitor fix -- prevent displaying red background for db status and bug in is_db_machine lookup
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
<%
|
||||
host_id = host.host.replace('.', '-')
|
||||
load = host.load()
|
||||
load_level = min(max(int(load+0.5), 0),5)
|
||||
load_level = min(max(int(load+0.4), 0),4)
|
||||
%>
|
||||
<tr class="load${load_level} title-region" id="${host_id}">
|
||||
<th>
|
||||
|
||||
@@ -40,7 +40,7 @@ def is_db_machine(host):
|
||||
for ip in ips:
|
||||
name = socket.gethostbyaddr(ip)[0]
|
||||
if (name == host or ("." in host and name.endswith("." + host)) or
|
||||
name.endswith(host + ".")):
|
||||
name.startswith(host + ".")):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user