(self, response)
return stats
Examine the response and raise an error is something is off
Examine the response and raise an error is something is off
Examine the response and raise an error is something is off
def _process_response(self, response):
        """
        Examine the response and raise an error is something is off
        """
        if len(response) != 1:
            raise BadResponseError("Malformed response: {}".format(response))

        stats = list(itervalues(response))[0]
        if not len(stats):
            raise BadResponseError("Malformed response for host: {}".format(stats))

        if 'version' in stats:
            self.set_metadata('version', stats['version'].decode('utf-8'))
        else:
            self.log.debug('Cannot determine Memcached version')
        return stats
def _process_response ( self , response ) : if len ( response ) != 1 : raise BadResponseError ( "Malformed response: {}" . format ( response ) ) stats = list ( itervalues ( response ) ) [ 0 ] if not len ( stats ) : raise BadResponseError ( "Malformed response for host: {}" . format ( stats ) ) if 'version' in stats : self . set_metadata ( 'version' , stats [ 'version' ] . decode ( 'utf-8' ) ) else : self . log . debug ( 'Cannot determine Memcached version' ) return stats