Skip to content

Commit

Permalink
Get blessed HostOS versions using dre registry. (#1242)
Browse files Browse the repository at this point in the history
  • Loading branch information
DFINITYManu authored Jan 22, 2025
1 parent a3bfc15 commit d5b40c5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions release-controller/dre_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ def get_blessed_versions(self) -> list[str]:
)["value"]["blessed_version_ids"],
)

def get_blessed_hostos_versions(self) -> set[str]:
"""Query the blessed versions."""
return set(
typing.cast(
list[str],
[
n["hostos_version_id"]
for n in json.loads(
subprocess.check_output([self.cli, "registry"], env=self.env)
)["nodes"]
if "hostos_version_id" in n and n["hostos_version_id"].strip()
],
)
)

def get_past_election_proposals(self) -> list[ElectionProposal]:
"""Get all known GuestOS election proposals."""
return typing.cast(
Expand Down Expand Up @@ -144,3 +159,8 @@ def place_proposal(
# We will not parse the text here. We dry-ran the thing, after all,
# so there will be no proposal ID to parse.
return 0


if __name__ == "__main__":
cli = DRECli()
print(cli.get_blessed_hostos_versions())

0 comments on commit d5b40c5

Please sign in to comment.