swift/proxy/controllers/obj.py
def _check_failure_put_connections(self, putters, req, min_conns):
        """
        Identify any failed connections and check minimum connection count.

        :param putters: a list of Putter instances
        :param req: request
        :param min_conns: minimum number of putter connections required
        """
        if req.if_none_match is not None and '*' in req.if_none_match:
            statuses = [
                putter.resp.status for putter in putters if putter.resp]
            if HTTP_PRECONDITION_FAILED in statuses:
                # If we find any copy of the file, it shouldn't be uploaded
                self.app.logger.debug(
                    _('Object PUT returning 412, %(statuses)r'),
                    {'statuses': statuses})
                raise HTTPPreconditionFailed(request=req)

        if any(putter for putter in putters if putter.resp and
               putter.resp.status == HTTP_CONFLICT):
            status_times = ['%(status)s (%(timestamp)s)' % {
                'status': putter.resp.status,
                'timestamp': HeaderKeyDict(
                    putter.resp.getheaders()).get(
                        'X-Backend-Timestamp', 'unknown')
            } for putter in putters if putter.resp]
            self.app.logger.debug(
                _('Object PUT returning 202 for 409: '
                  '%(req_timestamp)s <= %(timestamps)r'),
                {'req_timestamp': req.timestamp.internal,
                 'timestamps': ', '.join(status_times)})
            raise HTTPAccepted(request=req)

        self._check_min_conn(req, putters, min_conns)

        Identify any failed connections and check minimum connection count.

        :param putters: a list of Putter instances
        :param req: request
        :param min_conns: minimum number of putter connections required
        
Identify any failed connections and check minimum connection count.
Identify any failed connections and check minimum connection count .
def _check_failure_put_connections(self, putters, req, min_conns):
        if req.if_none_match is not None and '*' in req.if_none_match:
            statuses = [
                putter.resp.status for putter in putters if putter.resp]
            if HTTP_PRECONDITION_FAILED in statuses:
                self.app.logger.debug(
                    _('Object PUT returning 412, %(statuses)r'),
                    {'statuses': statuses})
                raise HTTPPreconditionFailed(request=req)
        if any(putter for putter in putters if putter.resp and
               putter.resp.status == HTTP_CONFLICT):
            status_times = ['%(status)s (%(timestamp)s)' % {
                'status': putter.resp.status,
                'timestamp': HeaderKeyDict(
                    putter.resp.getheaders()).get(
                        'X-Backend-Timestamp', 'unknown')
            } for putter in putters if putter.resp]
            self.app.logger.debug(
                _('Object PUT returning 202 for 409: '
                  '%(req_timestamp)s <= %(timestamps)r'),
                {'req_timestamp': req.timestamp.internal,
                 'timestamps': ', '.join(status_times)})
            raise HTTPAccepted(request=req)
        self._check_min_conn(req, putters, min_conns)
def _check_failure_put_connections ( self , putters , req , min_conns ) : if req . if_none_match is not None and '*' in req . if_none_match : statuses = [ putter . resp . status for putter in putters if putter . resp ] if HTTP_PRECONDITION_FAILED in statuses : self . app . logger . debug ( _ ( 'Object PUT returning 412, %(statuses)r' ) , { 'statuses' : statuses } ) raise HTTPPreconditionFailed ( request = req ) if any ( putter for putter in putters if putter . resp and putter . resp . status == HTTP_CONFLICT ) : status_times = [ '%(status)s (%(timestamp)s)' % { 'status' : putter . resp . status , 'timestamp' : HeaderKeyDict ( putter . resp . getheaders ( ) ) . get ( 'X-Backend-Timestamp' , 'unknown' ) } for putter in putters if putter . resp ] self . app . logger . debug ( _ ( 'Object PUT returning 202 for 409: ' '%(req_timestamp)s <= %(timestamps)r' ) , { 'req_timestamp' : req . timestamp . internal , 'timestamps' : ', ' . join ( status_times ) } ) raise HTTPAccepted ( request = req ) self . _check_min_conn ( req , putters , min_conns )
Identify any failed connections and check minimum connection count.
Identify any failed connections and check minimum connection count .
"""
        Identify any failed connections and check minimum connection count.

        :param putters: a list of Putter instances
        :param req: request
        :param min_conns: minimum number of putter connections required
        """ # If we find any copy of the file, it shouldn't be uploaded
self
putters
a list of Putter instances
a list of Putter instances
req
None
min_conns
minimum number of putter connections required
minimum number of putter connections required