sonic-net / sonic-py-swsssdk

Python SONiC switch state service sdk
Other
13 stars 86 forks source link

Changes to Use Redis Unix Socket if the user is root else default to TCP #120

Closed abdosi closed 2 years ago

abdosi commented 2 years ago

What I did: Changes to Use Redis Unix Socket if the user is root else default to TCP

Why I did: 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 or to the root. 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 in sonic-cfggen.

This should fix: https://github.com/Azure/sonic-buildimage/issues/8501

How I did: Without this change acl-loader update full erspan_acl_rule_del.json --table_name EVERFLOW is failing if given without sudo. Post this change it is passing.

judyjoseph commented 2 years ago

LGTM, will check the dbconnector library behavior in sonic-swss-common also, as utilities/scripts use this as well.

qiluo-msft commented 2 years ago

Agree. Please make sonic-swss-common implementation of SonicV2Connector on-par.


In reply to: 1086176608