Skip to content

Commit

Permalink
Make filters arg optional to get_namespaces_info() (SOFTWARE-5862)
Browse files Browse the repository at this point in the history
  • Loading branch information
matyasselmeci committed May 17, 2024
1 parent 93d9e80 commit be694b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/stashcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def get_scitokens_list_for_namespace(ns: Namespace) -> List[Dict]:
)


def get_namespaces_info(global_data: GlobalData, filters: NamespacesFilters) -> PreJSON:
def get_namespaces_info(global_data: GlobalData, filters: Optional[NamespacesFilters] = None) -> PreJSON:
"""Return data for the /stashcache/namespaces JSON endpoint.
This includes a list of caches and origins, with some data about their endpoints,
Expand All @@ -547,6 +547,9 @@ def get_namespaces_info(global_data: GlobalData, filters: NamespacesFilters) ->
If `include_downed` is True, caches/origins in downtime are also included.
If `include_inactive` is True, caches/origins that are not marked as active are also included.
"""
if filters is None:
filters = NamespacesFilters()

# Helper functions

def _service_resource_dict(
Expand Down

0 comments on commit be694b0

Please sign in to comment.