Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kedhammar/TACA
Browse files Browse the repository at this point in the history
  • Loading branch information
kedhammar committed Jun 17, 2024
2 parents cb4a0ac + 1114900 commit 7d53947
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions VERSIONLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ Run mypy for entire repo regardless of depth.

Use run-specific name to find Anglerfish samplesheet.

## 20240521.1
## 20240523.1

Reduce redundant specificity for anglerfish samplesheet pattern
Update server status to run on ngi-preproc

## 20240520.1

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 7d53947

Please sign in to comment.