← Back to team overview

openstack team mailing list archive

[SWIFT] code reading

 

Hi, Chmouel and Darrell

I know you're working on /swift/proxy/controllers/base.py for this bug:
https://review.openstack.org/#/c/21563/
I didn't know the
https://github.com/openstack/swift/blob/master/swift/proxy/controllers/base.py#L371
to
#372. Could you show me a simple understanding?

                    elif resp.status == HTTP_NOT_FOUND:
                        if result_code == 0:
                            result_code = HTTP_NOT_FOUND
                        elif result_code != HTTP_NOT_FOUND:
                            result_code = -1

In this part, given a 404 response, we should reset the variable
result_code. If result_code is 0, reset it 404, 404 do nothing, and
others set -1.


What's the case for the "-1"?

Furthermore, I simply think resp.status is sufficient condition to set
result_code, so why these judgement need the result_code value in last
loop (while attempts_left loop).



Gareth

Follow ups