From a2ee6dd3012d0bbad61fe1d68a3de576a8964c6b Mon Sep 17 00:00:00 2001 From: Yona Cohen Date: Mon, 18 Sep 2023 13:49:58 +0300 Subject: [PATCH] use_unix_socket_path depending on other args --- src/sonic_ax_impl/mibs/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sonic_ax_impl/mibs/__init__.py b/src/sonic_ax_impl/mibs/__init__.py index 3a6a8bb0a..c431de937 100644 --- a/src/sonic_ax_impl/mibs/__init__.py +++ b/src/sonic_ax_impl/mibs/__init__.py @@ -210,7 +210,9 @@ def split_sai_id_key(sai_id_key): def config(**kwargs): global redis_kwargs - redis_kwargs = {k:v for (k,v) in kwargs.items() if k in ['unix_socket_path', 'host', 'port', 'use_unix_socket_path']} + redis_kwargs = {k:v for (k,v) in kwargs.items() if k in ['unix_socket_path', 'host', 'port']} + if 'unix_socket_path' in redis_kwargs and 'host' in redis_kwargs and 'port' in redis_kwargs: + redis_kwargs['use_unix_socket_path'] = True redis_kwargs['decode_responses'] = True def init_db():