)]}'
{"quantum/agent/metadata/agent.py":[{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"a56215567c5c0c71e2a03150da0f5272f84e5144","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        method \u003d req.headers.get(\u0027X-HTTP-Method\u0027, req.method)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        h \u003d httplib2.Http()"},{"line_number":144,"context_line":"        resp, content \u003d h.request(url, method, headers\u003dheaders, body\u003dreq.body)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        if resp.status \u003d\u003d 200:"},{"line_number":147,"context_line":"            LOG.debug(str(resp))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FnjI%3D","line":144,"updated":"2013-05-01 18:06:21.000000000","message":"Better to use keyword argument like this: h.requests(url, method\u003dmethod ...)","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"unresolved":false,"context_lines":[{"line_number":141,"context_line":"        method \u003d req.headers.get(\u0027X-HTTP-Method\u0027, req.method)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        h \u003d httplib2.Http()"},{"line_number":144,"context_line":"        resp, content \u003d h.request(url, method, headers\u003dheaders, body\u003dreq.body)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        if resp.status \u003d\u003d 200:"},{"line_number":147,"context_line":"            LOG.debug(str(resp))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fnas%3D","line":144,"in_reply_to":"AAAAOn%2F%2FnjI%3D","updated":"2013-05-01 19:16:07.000000000","message":"Done","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"a56215567c5c0c71e2a03150da0f5272f84e5144","unresolved":false,"context_lines":[{"line_number":155,"context_line":"            return webob.exc.HTTPForbidden()"},{"line_number":156,"context_line":"        elif resp.status \u003d\u003d 404:"},{"line_number":157,"context_line":"            return webob.exc.HTTPNotFound()"},{"line_number":158,"context_line":"        elif resp.status \u003d\u003d 409:"},{"line_number":159,"context_line":"            return webob.exc.HTTPConflict()"},{"line_number":160,"context_line":"        elif resp.status \u003d\u003d 500:"},{"line_number":161,"context_line":"            msg \u003d _("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fni4%3D","line":158,"updated":"2013-05-01 18:06:21.000000000","message":"This change doesn\u0027t scale for upcoming changes in the metadata service, what do you think about replacing all this lines with : return webob.response.Response(body\u003dbody, status\u003dresp.status) ?","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"unresolved":false,"context_lines":[{"line_number":155,"context_line":"            return webob.exc.HTTPForbidden()"},{"line_number":156,"context_line":"        elif resp.status \u003d\u003d 404:"},{"line_number":157,"context_line":"            return webob.exc.HTTPNotFound()"},{"line_number":158,"context_line":"        elif resp.status \u003d\u003d 409:"},{"line_number":159,"context_line":"            return webob.exc.HTTPConflict()"},{"line_number":160,"context_line":"        elif resp.status \u003d\u003d 500:"},{"line_number":161,"context_line":"            msg \u003d _("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FnaU%3D","line":158,"in_reply_to":"AAAAOn%2F%2Fni4%3D","updated":"2013-05-01 19:16:07.000000000","message":"IMO the refactoring that you suggest should be done in a separate patch as it affects also code not strictly related to this patch.","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"}],"quantum/agent/metadata/namespace_proxy.py":[{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"a56215567c5c0c71e2a03150da0f5272f84e5144","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def __call__(self, req):"},{"line_number":75,"context_line":"        LOG.debug(_(\"Request: %s\"), req)"},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            return self._proxy_request(req.remote_addr,"},{"line_number":78,"context_line":"                                       req.method,"},{"line_number":79,"context_line":"                                       req.path_info,"},{"line_number":80,"context_line":"                                       req.query_string,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FniQ%3D","line":77,"updated":"2013-05-01 18:06:21.000000000","message":"I think this method should be changed to accept only one argument (the request), instead of passing all this argument that are all request attributes ! IMHO the code will be much cleaner .","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"unresolved":false,"context_lines":[{"line_number":74,"context_line":"    def __call__(self, req):"},{"line_number":75,"context_line":"        LOG.debug(_(\"Request: %s\"), req)"},{"line_number":76,"context_line":"        try:"},{"line_number":77,"context_line":"            return self._proxy_request(req.remote_addr,"},{"line_number":78,"context_line":"                                       req.method,"},{"line_number":79,"context_line":"                                       req.path_info,"},{"line_number":80,"context_line":"                                       req.query_string,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FnZQ%3D","line":77,"in_reply_to":"AAAAOn%2F%2FniQ%3D","updated":"2013-05-01 19:16:07.000000000","message":"I preferred to continue in the same way the original author did it in order to have better control on the arguments as the request is proxied through a Unix socket.","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"a56215567c5c0c71e2a03150da0f5272f84e5144","unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def _proxy_request(self, remote_address, method, path_info,"},{"line_number":89,"context_line":"                       query_string, body):"},{"line_number":90,"context_line":"        headers \u003d {"},{"line_number":91,"context_line":"            \u0027X-Forwarded-For\u0027: remote_address,"},{"line_number":92,"context_line":"            \u0027X-HTTP-Method\u0027: method,"},{"line_number":93,"context_line":"        }"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fnis%3D","line":91,"updated":"2013-05-01 18:06:21.000000000","message":"Why did you choose to use X-HTTP-method rather than just doing like this:  h.request(url, method\u003dmethod, ...) ? This way the proxy will be transparent which is what we want right ?","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"unresolved":false,"context_lines":[{"line_number":88,"context_line":"    def _proxy_request(self, remote_address, method, path_info,"},{"line_number":89,"context_line":"                       query_string, body):"},{"line_number":90,"context_line":"        headers \u003d {"},{"line_number":91,"context_line":"            \u0027X-Forwarded-For\u0027: remote_address,"},{"line_number":92,"context_line":"            \u0027X-HTTP-Method\u0027: method,"},{"line_number":93,"context_line":"        }"},{"line_number":94,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FnaA%3D","line":91,"in_reply_to":"AAAAOn%2F%2Fnis%3D","updated":"2013-05-01 19:16:07.000000000","message":"The approach you suggested has been tried at first of course. Being a Unix Socket, the method becomes always GET on the other end.","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"a56215567c5c0c71e2a03150da0f5272f84e5144","unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        url \u003d urlparse.urlunsplit(("},{"line_number":101,"context_line":"            \u0027http\u0027,"},{"line_number":102,"context_line":"            \u0027169.254.169.254\u0027,  # a dummy value to make the request proper"},{"line_number":103,"context_line":"            path_info,"},{"line_number":104,"context_line":"            query_string,"},{"line_number":105,"context_line":"            \u0027\u0027))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fnik%3D","line":102,"updated":"2013-05-01 18:06:21.000000000","message":"Some refactoring, i think the comment here should be for the 105 line !","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"unresolved":false,"context_lines":[{"line_number":99,"context_line":""},{"line_number":100,"context_line":"        url \u003d urlparse.urlunsplit(("},{"line_number":101,"context_line":"            \u0027http\u0027,"},{"line_number":102,"context_line":"            \u0027169.254.169.254\u0027,  # a dummy value to make the request proper"},{"line_number":103,"context_line":"            path_info,"},{"line_number":104,"context_line":"            query_string,"},{"line_number":105,"context_line":"            \u0027\u0027))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FnZ0%3D","line":102,"in_reply_to":"AAAAOn%2F%2Fnik%3D","updated":"2013-05-01 19:16:07.000000000","message":"Again, the refactoring you suggest IMO should go in a separate patch.","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"a56215567c5c0c71e2a03150da0f5272f84e5144","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            body\u003dbody,"},{"line_number":112,"context_line":"            connection_type\u003dUnixDomainHTTPConnection)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if resp.status \u003d\u003d 200:"},{"line_number":115,"context_line":"            LOG.debug(resp)"},{"line_number":116,"context_line":"            LOG.debug(content)"},{"line_number":117,"context_line":"            return content"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2Fnic%3D","line":114,"updated":"2013-05-01 18:06:21.000000000","message":"Same argument as for the agent, why not just doing: return webob.response.Response(body\u003dcontent, status\u003dresp.status)","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"            body\u003dbody,"},{"line_number":112,"context_line":"            connection_type\u003dUnixDomainHTTPConnection)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"        if resp.status \u003d\u003d 200:"},{"line_number":115,"context_line":"            LOG.debug(resp)"},{"line_number":116,"context_line":"            LOG.debug(content)"},{"line_number":117,"context_line":"            return content"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOn%2F%2FnZo%3D","line":114,"in_reply_to":"AAAAOn%2F%2Fnic%3D","updated":"2013-05-01 19:16:07.000000000","message":"See reply on the corresponding comment on the agent.","commit_id":"a1cc1ca3b4ed68ae5668cebf145a4682d0f41a66"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":89,"context_line":"                       query_string, body):"},{"line_number":90,"context_line":"        headers \u003d {"},{"line_number":91,"context_line":"            \u0027X-Forwarded-For\u0027: remote_address,"},{"line_number":92,"context_line":"            # A header is required for passing the original HTTP method as"},{"line_number":93,"context_line":"            # by using UnixDomainHTTPConnection the request returns always GET"},{"line_number":94,"context_line":"            # on the server side."},{"line_number":95,"context_line":"            \u0027X-HTTP-Method\u0027: method,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FnNA%3D","line":92,"updated":"2013-05-01 21:05:27.000000000","message":"I don\u0027t think this is true.  Why not add method\u003dmethod line 112?","commit_id":"e7e55c8f8625d95723939f69197ffdb553ff43cc"},{"author":{"_account_id":3185,"name":"Alessandro Pilotti","email":"apilotti@cloudbasesolutions.com","username":"alexpilotti"},"unresolved":false,"context_lines":[{"line_number":89,"context_line":"                       query_string, body):"},{"line_number":90,"context_line":"        headers \u003d {"},{"line_number":91,"context_line":"            \u0027X-Forwarded-For\u0027: remote_address,"},{"line_number":92,"context_line":"            # A header is required for passing the original HTTP method as"},{"line_number":93,"context_line":"            # by using UnixDomainHTTPConnection the request returns always GET"},{"line_number":94,"context_line":"            # on the server side."},{"line_number":95,"context_line":"            \u0027X-HTTP-Method\u0027: method,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAOn%2F%2FnMM%3D","line":92,"in_reply_to":"AAAAOn%2F%2FnNA%3D","updated":"2013-05-01 21:21:36.000000000","message":"That was of course the first thing I tried, it didn\u0027t work. On the agent side I always got \"GET\" in req.method, to my amazement. :-)\n\nThe only explanation I had was the usage of a different connection_type class, as setting the HTTP method in the request works perfectly well in the other connections (w/o custom connection_type).","commit_id":"e7e55c8f8625d95723939f69197ffdb553ff43cc"}]}
