Skip to content

Commit

Permalink
Reflect restructured yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
aanil committed May 23, 2024
1 parent ab8aec2 commit 63c5d63
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions taca/server_status/server_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,22 @@ def get_nases_disk_space():
config = CONFIG["server_status"]
servers = config.get("servers", dict())

for server_url, path_vars in servers.items():
for server_name, path_vars in servers.items():
# Get command
command = config["command"]
if server_url == "localhost":
path = path_vars["path"]
server_url = path_vars["name"]
path = path_vars["path"]
if path_vars["url"] == "localhost":
command = f"{command} {path}".split()
else:
command = f"{command} {path_vars}"
if "promethion" in server_url:
command = f"{command} {path}"
if "promethion" in server_name:
user = "prom"
else:
user = config["user"]
# Connect via ssh to server and execute the command
command = ["ssh", "-t", f"{user}@{server_url}", command]
command = ["ssh", "-t", f"{user}@{path_vars['url']}", command]

result[server_url] = _run_cmd(command)
result[server_name] = _run_cmd(command)

# Storage systems are mouted locally, e.g. ngi-nas
for storage_system, path in config.get("storage_systems", {}).items():
Expand Down

0 comments on commit 63c5d63

Please sign in to comment.