Permalink
Browse files

Merge pull request #3 from stepmr/patch-1

Allow redis connection without password
  • Loading branch information...
2 parents 7ab6d5b + d9e5b1d commit 2275124c67146abb71f504aa1382d0eb117c0231 @bianjiang committed Mar 4, 2015
Showing with 4 additions and 4 deletions.
  1. +4 −4 tweetf0rm/redis_helper.py
@@ -17,18 +17,18 @@ def __init__(self, name, namespace='default', redis_config=None):
self.redis_config = redis_config
self.__redis_connection = redis.StrictRedis(host=redis_config['host'], port=redis_config['port'], db=redis_config['db'])
- self.password = redis_config['password']
+ self.password = redis_config.get('password', None)
self.namespace = namespace
self.name = name
self.key = '%s:%s'%(self.namespace, self.name)
- if (self.password):
- self.__auth()
+ self.__auth()
def get_key(self):
return self.key
def __auth(self):
- self.__redis_connection.execute_command("AUTH", self.password)
+ if self.password:
+ self.__redis_connection.execute_command("AUTH", self.password)
def conn(self):
self.__auth()

0 comments on commit 2275124

Please sign in to comment.