From 78f167e4728f939712b3f3ea550949e2ea675fec Mon Sep 17 00:00:00 2001 From: Abhishek Dosi Date: Fri, 1 Apr 2022 17:07:34 +0000 Subject: [PATCH] With the changes in PR:https://github.com/Azure/sonic-buildimage/pull/5289 access to redis unix socket is given to the redis group members. Many of sonic-util commands (especially in multi-asic) case use redis unix socket to connect to DB and thus those comamnd fails without providing sudo. This PR is continuation of PR: https://github.com/Azure/sonic-buildimage/pull/7002 where we default to use TCP for Redis if user is not root Signed-off-by: Abhishek Dosi --- src/swsssdk/dbconnector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/swsssdk/dbconnector.py b/src/swsssdk/dbconnector.py index d2636399..23991e41 100644 --- a/src/swsssdk/dbconnector.py +++ b/src/swsssdk/dbconnector.py @@ -244,7 +244,7 @@ def __init__(self, use_unix_socket_path=False, namespace=None, decode_responses= kwargs['decode_responses'] = True self.dbintf = DBInterface(**kwargs) - self.use_unix_socket_path = use_unix_socket_path + self.use_unix_socket_path = True if use_unix_socket_path and os.getuid() == 0 else False """If the user don't give the namespace as input, it refers to the local namespace where this application is run. (It could be a network namespace or linux host namesapce)