From ca87bdd7817431c163f0913878c12342ea8ad169 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 17 Nov 2017 02:45:03 +0000 Subject: [PATCH] [configdb] support redis connecting methods other than TCP Signed-off-by: Wataru Ishida --- src/swsssdk/configdb.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/swsssdk/configdb.py b/src/swsssdk/configdb.py index 20e7f2daf..68082d7fa 100644 --- a/src/swsssdk/configdb.py +++ b/src/swsssdk/configdb.py @@ -28,9 +28,11 @@ class ConfigDBConnector(SonicV2Connector): TABLE_NAME_SEPARATOR = '|' KEY_SEPARATOR = '|' - def __init__(self): - # Connect to Redis through TCP, which does not requires root. - super(ConfigDBConnector, self).__init__(host='127.0.0.1') + def __init__(self, **kwargs): + # By default, connect to Redis through TCP, which does not requires root. + if len(kwargs) == 0: + kwargs['host'] = '127.0.0.1' + super(ConfigDBConnector, self).__init__(**kwargs) self.handlers = {} def __wait_for_db_init(self):