def is_redis_available():
 redis_conn = connect_to_redis()
 try:
  return redis_conn.ping()
 except Exception:
  log.exception(u'Redis is not available')
  return False

def is_redis_available ( ) : redis_conn = connect_to_redis ( ) try : return redis_conn . ping ( ) except Exception : log . exception ( u'Redis is not available' ) return False
check whether redis is available .