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

Add "include_downed" and "include_inactive" params to the /osdf/namespaces endpoint #3659

Conversation

matyasselmeci
Copy link
Collaborator

If set, the output will not exclude caches/origins that are in downtime, or marked as inactive.
(SOFTWARE-5826)

Along the way, I noticed that if I try to pass a downtime file (with an entire list of downtimes) to Topology.add_downtime() it will fail with a KeyError because it was expecting a dict. This was unexpected so I added checks.

…paces endpoint

If set, the output will _not_ exclude caches/origins that are in downtime, or marked as inactive.
(SOFTWARE-5826)
(writing a test for `?include_downed=1` requires making a test downtime file first)
A parsed yaml can be a list, not just a dict (it can be a scalar too, but I'll ignore that for now),
but Topology.add_downtime() assumed dict, passed it to Downtime(), which raised a confusing KeyError.

1. Update the definition of ParsedYaml to indicate that it can be a list too;
   hopefully I'll catch things like this next time
2. If given a list, have add_downtime() add all the downtimes in the list.
Copy link
Member

@brianhlin brianhlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matyasselmeci matyasselmeci merged commit a85c7c3 into opensciencegrid:master Feb 19, 2024
2 checks passed
@matyasselmeci matyasselmeci deleted the pr/namespaces-params.SOFTWARE-5826 branch February 19, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants