migrate health_check.py to python3

This commit is contained in:
Harry Chen authored and Beichi-CHs committed 2021-11-18 18:51:29 +08:00
1 parent cef608b809
commit 040fb6fbbd
1 file changed
+2 -2
+2 -2
View File
@@ -1,8 +1,8 @@
import xmlrpclib import xmlrpc.client
if __name__ == "__main__": if __name__ == "__main__":
try: try:
server = xmlrpclib.Server("http://localhost:9005/RPC2") with xmlrpc.client.ServerProxy("http://localhost:9005/RPC2") as server:
info = server.supervisor.getAllProcessInfo() info = server.supervisor.getAllProcessInfo()
error_states = list(filter(lambda x: x["state"] != 20, info)) error_states = list(filter(lambda x: x["state"] != 20, info))
exit(len(error_states)) exit(len(error_states))