You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vnet_route_check TCP socket for DB connection. (sonic-net#3578)
Currently the Vnet_route_check fails if a user calls it witout sudo with the following error.
```
Traceback (most recent call last):
File "/usr/local/bin/vnet_route_check.py", line 401, in <module>
sys.exit(main())
File "/usr/local/bin/vnet_route_check.py", line 364, in main
if not check_vnet_cfg():
File "/usr/local/bin/vnet_route_check.py", line 77, in check_vnet_cfg
db = swsscommon.DBConnector('APPL_DB', 0)
File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 1656, in __init__
_swsscommon.DBConnector_swiginit(self, _swsscommon.new_DBConnector(*args))
RuntimeError: Unable to connect to redis (unix-socket): Cannot assign requested address
```
#### What I did
The **route_check** script accesses the same DB tables but is able to run without the sudo rights. To solve this problem I have changed the **Vnet_route_check** to use a TCP socket to connect to the DB as done in **route_check**. As a result the script doesn't fail with a run time error.
#### How I did it
#### How to verify it
create a new user on a T1 device which has no docker or sudoers privilage. run vnet_route check. it should fail.
#### Previous command output (if the output of a command-line utility has changed)
```
Traceback (most recent call last):
File "/usr/local/bin/vnet_route_check.py", line 401, in <module>
sys.exit(main())
File "/usr/local/bin/vnet_route_check.py", line 364, in main
if not check_vnet_cfg():
File "/usr/local/bin/vnet_route_check.py", line 77, in check_vnet_cfg
db = swsscommon.DBConnector('APPL_DB', 0)
File "/usr/lib/python3/dist-packages/swsscommon/swsscommon.py", line 1656, in __init__
_swsscommon.DBConnector_swiginit(self, _swsscommon.new_DBConnector(*args))
RuntimeError: Unable to connect to redis (unix-socket): Cannot assign requested address
```
0 commit comments