Skip to content

Commit

Permalink
fix: return kwargs from _prune_redis_kwargs (#1014)
Browse files Browse the repository at this point in the history
  • Loading branch information
jshimkus-rh authored Aug 19, 2024
1 parent 9c7762d commit a258c08
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/aap_eda/core/tasking/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _create_url_from_parameters(**kwargs) -> str:
return url


def _prune_redis_kwargs(**kwargs) -> None:
def _prune_redis_kwargs(**kwargs) -> dict[str, Any]:
"""Prunes the kwargs of unsupported parameters for RedisCluster."""
# HA cluster does not support an alternate redis db and will generate an
# exception if we pass a value (even the default). If we're in that
Expand All @@ -93,6 +93,7 @@ def _prune_redis_kwargs(**kwargs) -> None:
f"clustered redis supports only the default db"
f"; db specified: {db}"
)
return kwargs


def get_redis_client(**kwargs) -> Union[DABRedis, DABRedisCluster]:
Expand All @@ -101,14 +102,14 @@ def get_redis_client(**kwargs) -> Union[DABRedis, DABRedisCluster]:
DAB will return an appropriate client for HA based on the passed
parameters.
"""
_prune_redis_kwargs(**kwargs)
kwargs = _prune_redis_kwargs(**kwargs)
return _get_redis_client(_create_url_from_parameters(**kwargs), **kwargs)


def get_redis_status() -> dict:
"""Query DAB for the status of Redis."""
kwargs = default.rq_redis_client_instantiation_parameters()
_prune_redis_kwargs(**kwargs)
kwargs = _prune_redis_kwargs(**kwargs)
return _get_redis_status(_create_url_from_parameters(**kwargs), **kwargs)


Expand Down

0 comments on commit a258c08

Please sign in to comment.