Skip to content

Commit

Permalink
Merge pull request #427 from aanil/master
Browse files Browse the repository at this point in the history
Update server status to reflect ngi-preproc
  • Loading branch information
aanil authored May 24, 2024
2 parents 7f75636 + 63c5d63 commit 40268ad
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions VERSIONLOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# TACA Version Log

## 20240523.1

Update server status to run on ngi-preproc

## 20240520.1

Fix erroneous name of pod5 output dir for ONT runs.
Expand Down
18 changes: 9 additions & 9 deletions taca/server_status/server_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ def get_nases_disk_space():
config = CONFIG["server_status"]
servers = config.get("servers", dict())

for server_url, path in servers.items():
for server_name, path_vars in servers.items():
# Get command
command = "{command} {path}".format(command=config["command"], path=path)

# If localhost, don't connect to ssh
if server_url == "localhost":
command = command.split()
command = config["command"]
path = path_vars["path"]
if path_vars["url"] == "localhost":
command = f"{command} {path}".split()
else:
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 40268ad

Please sign in to comment.