(req, logger)
General response validation
General response validation
General response validation
def validate_response(req, logger):
    ''' General response validation '''
    logger.debug("cloudflare: CloudFlare replied with " + str(req.status_code))
    if req.status_code == 200:
        data = json.loads(req.text)
        if data['success'] is True:
            return True
    else:
        logger.debug("cloudflare: Response text: %s" % req.text)
        return False
def validate_response ( req , logger ) : logger . debug ( "cloudflare: CloudFlare replied with " + str ( req . status_code ) ) if req . status_code == 200 : data = json . loads ( req . text ) if data [ 'success' ] is True : return True else : logger . debug ( "cloudflare: Response text: %s" % req . text ) return False