<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:12pt"><div>hi all,</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">somebody help me to understand the following lines of code of ObjectController.PUT() in swift.proxy.controllers.obj.py</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br></div><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51); line-height: 18px;"><div class="line" id="LC750" style="box-sizing:
border-box; padding-left: 10px;"><span class="k" style="box-sizing: border-box; font-weight: bold;">def</span> <span class="nf" style="box-sizing: border-box; color: rgb(153, 0, 0); font-weight: bold;">PUT</span><span class="p" style="box-sizing: border-box;">(</span><span class="bp" style="box-sizing: border-box; color: rgb(153, 153, 153);">self</span><span class="p" style="box-sizing: border-box;">,</span> <span class="n" style="box-sizing: border-box;">req</span><span class="p" style="box-sizing: border-box;">):</span></div><div class="line" id="LC751" style="box-sizing: border-box; padding-left: 10px;"> <span class="sd" style="box-sizing: border-box; color: rgb(221, 17, 68);">"""HTTP PUT request handler."""</span></div></pre><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent;
font-style: normal;">-----------</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="color: rgb(153, 153, 136); font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; font-style: italic; line-height: 18px; white-space: pre;"># do a HEAD request for container sync and checking object versions</span><br></div><pre style="box-sizing: border-box; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin-top: 0px; margin-bottom: 0px; color: rgb(51, 51, 51); line-height: 18px;"><div class="line" id="LC787" style="box-sizing: border-box; padding-left: 10px;"><span class="k" style="box-sizing: border-box; font-weight: bold;">if</span> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">'x-timestamp'</span> <span class="ow"
style="box-sizing: border-box; font-weight: bold;">in</span> <span class="n" style="box-sizing: border-box;">req</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">headers</span> <span class="ow" style="box-sizing: border-box; font-weight: bold;">or</span> \</div><div class="line" id="LC788" style="box-sizing: border-box; padding-left: 10px;"> <span class="p" style="box-sizing: border-box;">(</span><span class="n" style="box-sizing: border-box;">object_versions</span> <span class="ow" style="box-sizing: border-box; font-weight: bold;">and</span> <span class="ow" style="box-sizing: border-box; font-weight: bold;">not</span></div><div class="line" id="LC789" style="box-sizing: border-box; padding-left:
10px;"> <span class="n" style="box-sizing: border-box;">req</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">environ</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">get</span><span class="p" style="box-sizing: border-box;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">'swift_versioned_copy'</span><span class="p" style="box-sizing: border-box;">)):</span></div><div class="line" id="LC790" style="box-sizing: border-box; padding-left: 10px;"> <span class="n" style="box-sizing: border-box;">hreq</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="n"
style="box-sizing: border-box;">Request</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">blank</span><span class="p" style="box-sizing: border-box;">(</span><span class="n" style="box-sizing: border-box;">req</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">path_info</span><span class="p" style="box-sizing: border-box;">,</span> <span class="n" style="box-sizing: border-box;">headers</span><span class="o" style="box-sizing: border-box; font-weight: bold;">=</span><span class="p" style="box-sizing: border-box;">{</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">'X-Newest'</span><span class="p" style="box-sizing: border-box;">:</span> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">'True'</span><span class="p" style="box-sizing:
border-box;">},</span></div><div class="line" id="LC791" style="box-sizing: border-box; padding-left: 10px;"> <span class="n" style="box-sizing: border-box;">environ</span><span class="o" style="box-sizing: border-box; font-weight: bold;">=</span><span class="p" style="box-sizing: border-box;">{</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">'REQUEST_METHOD'</span><span class="p" style="box-sizing: border-box;">:</span> <span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">'HEAD'</span><span class="p" style="box-sizing: border-box;">})</span></div><div class="line" id="LC792" style="box-sizing: border-box; padding-left: 10px;"> <span
class="n" style="box-sizing: border-box;">hresp</span> <span class="o" style="box-sizing: border-box; font-weight: bold;">=</span> <span class="bp" style="box-sizing: border-box; color: rgb(153, 153, 153);">self</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">GETorHEAD_base</span><span class="p" style="box-sizing: border-box;">(</span></div><div class="line" id="LC793" style="box-sizing: border-box; padding-left: 10px;"> <span class="n" style="box-sizing: border-box;">hreq</span><span class="p" style="box-sizing: border-box;">,</span> <span class="n" style="box-sizing: border-box;">_</span><span class="p" style="box-sizing: border-box;">(</span><span class="s" style="box-sizing: border-box; color: rgb(221, 17, 68);">'Object'</span><span class="p" style="box-sizing:
border-box;">),</span> <span class="bp" style="box-sizing: border-box; color: rgb(153, 153, 153);">self</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">app</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">object_ring</span><span class="p" style="box-sizing: border-box;">,</span> <span class="n" style="box-sizing: border-box;">partition</span><span class="p" style="box-sizing: border-box;">,</span></div><div class="line" id="LC794" style="box-sizing: border-box; padding-left: 10px;"> <span class="n" style="box-sizing: border-box;">hreq</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">swift_entity_path</span><span class="p"
style="box-sizing: border-box;">)</span></div><div class="line" id="LC794" style="box-sizing: border-box; padding-left: 10px;"><span class="p" style="box-sizing: border-box;">-----------</span></div><div class="line" id="LC794" style="box-sizing: border-box; padding-left: 10px;"><span class="p" style="box-sizing: border-box;"><br></span></div><div class="line" id="LC794" style="box-sizing: border-box; padding-left: 10px;"><span class="p" style="box-sizing: border-box;"><span class="bp" style="box-sizing: border-box; color: rgb(153, 153, 153);">in the following lines of code, self</span><span class="o" style="box-sizing: border-box; font-weight: bold;">.</span><span class="n" style="box-sizing: border-box;">GETorHEAD_base</span><span class="p" style="box-sizing: border-box;">() create an HTTPConnection to object server for a HEAD request which is defined in ObjectController.HEAD() of swift.obj.server.py</span><br></span></div><div class="line" id="LC794"
style="box-sizing: border-box; padding-left: 10px;"><span class="p" style="box-sizing: border-box;"><span class="p" style="box-sizing: border-box;">But we are in process of putting object, object is not written till yet on the node, then what will it return to </span></span><span class="n" style="font-family: 'Courier New'; box-sizing: border-box;">hresp?</span></div><div class="line" id="LC794" style="box-sizing: border-box; padding-left: 10px;"><span class="n" style="font-family: 'Courier New'; box-sizing: border-box;"><br></span></div><div class="line" id="LC794" style="box-sizing: border-box; padding-left: 10px;"><span class="n" style="font-family: 'Courier New'; box-sizing: border-box;">thanks </span></div><div class="line" id="LC794" style="box-sizing: border-box; padding-left: 10px;"><span class="n" style="font-family: 'Courier New'; box-sizing: border-box;">Pragya Jain</span></div></pre></div></body></html>