Commit c05a51e6 authored by BO ZHANG's avatar BO ZHANG 🏀
Browse files

update DFS

parent 905613a9
...@@ -34,9 +34,10 @@ def check_port(ip, port, timeout=3): ...@@ -34,9 +34,10 @@ def check_port(ip, port, timeout=3):
class DFS: class DFS:
def __init__(self, location=None): def __init__(self, location=None):
# try each location # try each location
print("Test all locations:") print("Test all locations:", end="")
status_list = [] status_list = []
for loc in CONFIG.keys(): for loc in CONFIG.keys():
print(f"{loc}...", end="")
dfs_ip = CONFIG[loc]["dfs"]["CSST_DFS_GATEWAY"].split(":")[0] dfs_ip = CONFIG[loc]["dfs"]["CSST_DFS_GATEWAY"].split(":")[0]
dfs_port = int(CONFIG[loc]["dfs"]["CSST_DFS_GATEWAY"].split(":")[1]) dfs_port = int(CONFIG[loc]["dfs"]["CSST_DFS_GATEWAY"].split(":")[1])
redis_ip = CONFIG[loc]["redis"]["host"] redis_ip = CONFIG[loc]["redis"]["host"]
...@@ -50,7 +51,8 @@ class DFS: ...@@ -50,7 +51,8 @@ class DFS:
redis=this_redis_status, redis=this_redis_status,
) )
status_list.append(this_status) status_list.append(this_status)
print(this_status) # print(this_status)
print("Done!\n")
status_table = Table(status_list) status_table = Table(status_list)
print(status_table) print(status_table)
...@@ -83,10 +85,9 @@ class Redis(redis.Redis): ...@@ -83,10 +85,9 @@ class Redis(redis.Redis):
) )
self.qname = password = CONFIG[location]["redis"]["qname"] self.qname = password = CONFIG[location]["redis"]["qname"]
self.config = CONFIG[location]["redis"] self.config = CONFIG[location]["redis"]
# print("Setting redis config:")
print("Setting redis config:") # for k, v in self.config.items():
for k, v in self.config.items(): # print(f" - {k}: {v}")
print(f" - {k}: {v}")
def push(self, msg): def push(self, msg):
self.lpush(self.qname, msg) self.lpush(self.qname, msg)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment