Permalink
Browse files

Allow redis connection without password

- Fixed formatting
  • Loading branch information...
1 parent 7ab6d5b commit d9e5b1d91eaf8060801b95c108e18c0ebd3a7912 @stepmr stepmr 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 d9e5b1d

Please sign in to comment.