'Prepares hook to connect to a Redis database.
:param conn_id:     the name of the connection that has the parameters
we need to connect to Redis.'

def __init__(self, redis_conn_id='redis_default'):

    self.redis_conn_id = redis_conn_id
    self.client = None
    conn = self.get_connection(self.redis_conn_id)
    self.host = conn.host
    self.port = int(conn.port)
    self.password = conn.password
    self.db = int(conn.extra_dejson.get('db', 0))
    self.logger = logging.getLogger(__name__)
    self.logger.debug('Connection    "{conn}":\n                                                 DCTB host:    {host}\n                                                 DCTB port:    {port}\n                                                 DCTB extra:    {extra}\n                                                '.format(conn=self.redis_conn_id, host=self.host, port=self.port, extra=conn.extra_dejson))
