Skip to content

Commit

Permalink
Fix slurmrestd version function
Browse files Browse the repository at this point in the history
  • Loading branch information
rstyd committed Nov 4, 2024
1 parent eda2372 commit 7c8c667
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions beeflow/client/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import datetime
import time
import importlib.metadata
import packaging
from packaging.version import Version

import daemon
import typer
Expand Down Expand Up @@ -175,7 +175,8 @@ def get_slurmrestd_version():
api_versions = [line.split('/')[1] for line in resp[1:] if re.search(r"openapi/v\d+\.\d+\.\d+",
line)]
# Sort the versions and grab the newest one
newest_api = sorted(api_versions, key=packaging.version.Version, reverse=True)[0]
newest_api = sorted(api_versions, key=Version, reverse=True)[0]
print(f"Inferred slurmrestd version: {newest_api}")
return newest_api


Expand Down

0 comments on commit 7c8c667

Please sign in to comment.