Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get blessed HostOS versions using dre registry. #1242

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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],
[
DFINITYManu marked this conversation as resolved.
Show resolved Hide resolved
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()
DFINITYManu marked this conversation as resolved.
Show resolved Hide resolved
],
)
)

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())
Loading