)]}'
{"nova/api/openstack/extensions.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"5a5c1edba6c5b956cf8b914ea084ad56d0c7024c","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        # Deserialize the response body, if any"},{"line_number":165,"context_line":"        body \u003d None"},{"line_number":166,"context_line":"        if res.body:"},{"line_number":167,"context_line":"            body \u003d utils.loads(res.body)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        # currently request handlers are un-ordered"},{"line_number":170,"context_line":"        for handler in self.handlers:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8ik%3D","line":167,"updated":"2011-10-13 20:06:26.000000000","message":"I\u0027m not crazy about deserializing json like this. Is there any possible way we can align the two serialization paths?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"a5425006b4a98d60c5782f623f176628c80a2300","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        # Deserialize the response body, if any"},{"line_number":165,"context_line":"        body \u003d None"},{"line_number":166,"context_line":"        if res.body:"},{"line_number":167,"context_line":"            body \u003d utils.loads(res.body)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        # currently request handlers are un-ordered"},{"line_number":170,"context_line":"        for handler in self.handlers:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8Vs%3D","line":167,"in_reply_to":"AAAACX%2F%2F8Wg%3D","updated":"2011-10-14 19:18:05.000000000","message":"Let\u0027s just not worry about it for now. I think I understand it better. We can refactor later if we feel it is necessary.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"638fa55558dc42a92be91720867c2028582c5db7","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        # Deserialize the response body, if any"},{"line_number":165,"context_line":"        body \u003d None"},{"line_number":166,"context_line":"        if res.body:"},{"line_number":167,"context_line":"            body \u003d utils.loads(res.body)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        # currently request handlers are un-ordered"},{"line_number":170,"context_line":"        for handler in self.handlers:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8Wg%3D","line":167,"in_reply_to":"AAAACX%2F%2F8Yc%3D","updated":"2011-10-14 19:13:30.000000000","message":"Well, the issue I\u0027m trying to solve with serializing the body data at all is the fact that webob makes it difficult, if not impossible, to pass objects through the pipeline; it expects response.body to always be a string.  So, my options are, serialize the object to json, then have the lazy serialization middleware reserialize the object as appropriate; or, stuff the object into the request environment, which was a technique that hadn\u0027t occurred to me in the original lazy serialization change.  And if I\u0027m forced to serialize to pass the object, json is faster than pickle, which was the original serialization I had tried...","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"602b42b30c1447e979efb12a9442652f19649c50","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        # Deserialize the response body, if any"},{"line_number":165,"context_line":"        body \u003d None"},{"line_number":166,"context_line":"        if res.body:"},{"line_number":167,"context_line":"            body \u003d utils.loads(res.body)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        # currently request handlers are un-ordered"},{"line_number":170,"context_line":"        for handler in self.handlers:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8Yc%3D","line":167,"in_reply_to":"AAAACX%2F%2F8iQ%3D","updated":"2011-10-14 18:42:08.000000000","message":"Yeah, I don\u0027t like making xml serialization a special case. I would like to use the same lazy template serialization approach for both json AND xml.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"3aaec757fe4def61f4e12157e256c82f12205a92","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        # Deserialize the response body, if any"},{"line_number":165,"context_line":"        body \u003d None"},{"line_number":166,"context_line":"        if res.body:"},{"line_number":167,"context_line":"            body \u003d utils.loads(res.body)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        # currently request handlers are un-ordered"},{"line_number":170,"context_line":"        for handler in self.handlers:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8iQ%3D","line":167,"in_reply_to":"AAAACX%2F%2F8ik%3D","updated":"2011-10-13 20:31:06.000000000","message":"I\u0027m not sure I understand your question; could you elaborate?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"}],"nova/api/openstack/flavors.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"5a5c1edba6c5b956cf8b914ea084ad56d0c7024c","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def make_flavor(parent, selector, detailed\u003dFalse):"},{"line_number":95,"context_line":"    elem \u003d xmltmpl.SubTemplateElement(parent, \u0027flavor\u0027, selector\u003dselector)"},{"line_number":96,"context_line":"    elem.set(\u0027name\u0027, \u0027name\u0027)"},{"line_number":97,"context_line":"    elem.set(\u0027id\u0027, \u0027id\u0027)"},{"line_number":98,"context_line":"    if detailed:"},{"line_number":99,"context_line":"        elem.set(\u0027ram\u0027, \u0027ram\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8iw%3D","line":96,"updated":"2011-10-13 20:06:26.000000000","message":"This usage is a bit odd. Is there any way we can get what we want without having to duplicate every key name? Maybe defaulting the second arg to the first if it is not set?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"602b42b30c1447e979efb12a9442652f19649c50","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def make_flavor(parent, selector, detailed\u003dFalse):"},{"line_number":95,"context_line":"    elem \u003d xmltmpl.SubTemplateElement(parent, \u0027flavor\u0027, selector\u003dselector)"},{"line_number":96,"context_line":"    elem.set(\u0027name\u0027, \u0027name\u0027)"},{"line_number":97,"context_line":"    elem.set(\u0027id\u0027, \u0027id\u0027)"},{"line_number":98,"context_line":"    if detailed:"},{"line_number":99,"context_line":"        elem.set(\u0027ram\u0027, \u0027ram\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8YY%3D","line":96,"in_reply_to":"AAAACX%2F%2F8iM%3D","updated":"2011-10-14 18:42:08.000000000","message":"Excellent.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"3aaec757fe4def61f4e12157e256c82f12205a92","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def make_flavor(parent, selector, detailed\u003dFalse):"},{"line_number":95,"context_line":"    elem \u003d xmltmpl.SubTemplateElement(parent, \u0027flavor\u0027, selector\u003dselector)"},{"line_number":96,"context_line":"    elem.set(\u0027name\u0027, \u0027name\u0027)"},{"line_number":97,"context_line":"    elem.set(\u0027id\u0027, \u0027id\u0027)"},{"line_number":98,"context_line":"    if detailed:"},{"line_number":99,"context_line":"        elem.set(\u0027ram\u0027, \u0027ram\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8iM%3D","line":96,"in_reply_to":"AAAACX%2F%2F8iw%3D","updated":"2011-10-13 20:31:06.000000000","message":"In the set() calls?  I suppose we could.  Technically, the second parameter of \u0027name\u0027 is special; it\u0027s supposed to be a callable, but if it isn\u0027t, it\u0027s passed to Selector() to create one.  I don\u0027t guess it\u0027d be too horrible to make it default to None and do the same trick with the first parameter...","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"5a5c1edba6c5b956cf8b914ea084ad56d0c7024c","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8is%3D","line":115,"updated":"2011-10-13 20:06:26.000000000","message":"You shouldn\u0027t have to pass in None for parent, just make parent a kwarg that defaults to None. \n\nYou also shouldn\u0027t have to pass in \u0027flavor\u0027, as the function already has that context. You can call the other make_flavor usage make_flavors.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"1ed3b4311493517acc71151077f3084825b98759","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8Uw%3D","line":115,"in_reply_to":"AAAACX%2F%2F8U4%3D","updated":"2011-10-14 20:03:07.000000000","message":"The only difference between the trees returned by your suggested make_flavor() and make_flavors() are in the top-level element--in the make_flavor() case, the top-level element has no parent and uses a selector of \u0027flavor\u0027, while in the make_flavors() case, the top-level element has a parent and uses a selector of \u0027flavors\u0027; in both cases, the tag name is the same (\u0027flavor\u0027), as are attributes and children.  Unless I pull the top-level element creation out of make_flavor()/make_flavors() entirely, like I suggest, there\u0027s no way that one could be called from the other...and if I *do* pull the top-level element creation out of make_flavor()/make_flavors(), then there\u0027s no longer a need to have both.\n\n(Maybe you\u0027re thinking that make_flavor(None, \u0027flavor\u0027) returns a \u003cflavor\u003e tree and make_flavor(parent, \u0027flavors\u0027) returns a \u003cflavors\u003e tree with a \u003cflavor\u003e element?  That\u0027s not in fact the case; it always returns a \u003cflavor\u003e tree, and the parent argument is so that it can be attached to a caller-generated \u003cflavors\u003e element.)","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"2e648efb170fad56f973b81032031ecdaefc37d2","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8U4%3D","line":115,"in_reply_to":"AAAACX%2F%2F8VQ%3D","updated":"2011-10-14 19:45:45.000000000","message":"You wouldn\u0027t have to duplicate any code, I think you could write it in such a way that make_flavors used make_flavor to populate itself.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"aabb7e7d6d71ec3c4165124c6a0d31fa50cee9dd","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8VQ%3D","line":115,"in_reply_to":"AAAACX%2F%2F8Vo%3D","updated":"2011-10-14 19:33:14.000000000","message":"I\u0027d rather not break up make_flavor() to make make_flavors(); the only differences between them are that top-level element in the template, and making separate functions would violate DRY.  That said, I\u0027m willing to entertain a refactoring where that top-level element is created by the caller and passed in to make_flavor(), which would be responsible for only setting attributes and attaching child elements.  All the potentially duplicated code still lives in one function, while the function signature becomes significantly simplified.  Would that be acceptable?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"a5425006b4a98d60c5782f623f176628c80a2300","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8Vo%3D","line":115,"in_reply_to":"AAAACX%2F%2F8WY%3D","updated":"2011-10-14 19:18:05.000000000","message":"Yeah, and I think breaking up make_flavor and make_flavors would also be a good move.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"638fa55558dc42a92be91720867c2028582c5db7","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8WY%3D","line":115,"in_reply_to":"AAAACX%2F%2F8YU%3D","updated":"2011-10-14 19:13:30.000000000","message":"So, if I restructured make_flavor() and similar functions to use a lot more argument defaulting/keyword arguments, would that satisfy you?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"602b42b30c1447e979efb12a9442652f19649c50","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8YU%3D","line":115,"in_reply_to":"AAAACX%2F%2F8hw%3D","updated":"2011-10-14 18:42:08.000000000","message":"I guess I don\u0027t quite understand this as well as you do, but I\u0027m still going to stand by the need to simplify here.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"3aaec757fe4def61f4e12157e256c82f12205a92","unresolved":false,"context_lines":[{"line_number":112,"context_line":""},{"line_number":113,"context_line":"class FlavorTemplate(xmltmpl.TemplateBuilder):"},{"line_number":114,"context_line":"    def construct(self):"},{"line_number":115,"context_line":"        root \u003d make_flavor(None, \u0027flavor\u0027, detailed\u003dTrue)"},{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8hw%3D","line":115,"in_reply_to":"AAAACX%2F%2F8is%3D","updated":"2011-10-13 20:31:06.000000000","message":"I wanted to avoid having two different functions which built the same tree.  This comes down to the design choice of having the element selector be part of the element; in later thought, it seemed to me that bundling the selector and the element together (in a tuple, perhaps) would be better, because then it wouldn\u0027t be necessary to have a separate make_*() function like this...","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"5a5c1edba6c5b956cf8b914ea084ad56d0c7024c","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"class FlavorsTemplate(xmltmpl.TemplateBuilder):"},{"line_number":120,"context_line":"    def construct(self):"},{"line_number":121,"context_line":"        root \u003d xmltmpl.TemplateElement(\u0027flavors\u0027)"},{"line_number":122,"context_line":"        make_flavor(root, \u0027flavors\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8io%3D","line":119,"updated":"2011-10-13 20:06:26.000000000","message":"I would prefer to call this MinimalFlavorsTemplate (or something similar) and the other FlavorsTemplate. I like that pattern more than FlavorsTemplate and FlavorsDetailedTemplate.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"3aaec757fe4def61f4e12157e256c82f12205a92","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        return xmltmpl.MasterTemplate(root, 1, nsmap\u003dflavor_nsmap)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"class FlavorsTemplate(xmltmpl.TemplateBuilder):"},{"line_number":120,"context_line":"    def construct(self):"},{"line_number":121,"context_line":"        root \u003d xmltmpl.TemplateElement(\u0027flavors\u0027)"},{"line_number":122,"context_line":"        make_flavor(root, \u0027flavors\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8hk%3D","line":119,"in_reply_to":"AAAACX%2F%2F8io%3D","updated":"2011-10-13 20:31:06.000000000","message":"Makes sense.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"}],"nova/api/openstack/wsgi.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"5a5c1edba6c5b956cf8b914ea084ad56d0c7024c","unresolved":false,"context_lines":[{"line_number":470,"context_line":"                            action)"},{"line_number":471,"context_line":"        return response"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"    def serialize_headers(self, _request, response, data, action):"},{"line_number":474,"context_line":"        self.headers_serializer.serialize(response, data, action)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def serialize_body(self, request, response, data, content_type, action):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8ig%3D","line":473,"updated":"2011-10-13 20:06:26.000000000","message":"Why did you add _request if it is not used?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"602b42b30c1447e979efb12a9442652f19649c50","unresolved":false,"context_lines":[{"line_number":470,"context_line":"                            action)"},{"line_number":471,"context_line":"        return response"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"    def serialize_headers(self, _request, response, data, action):"},{"line_number":474,"context_line":"        self.headers_serializer.serialize(response, data, action)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def serialize_body(self, request, response, data, content_type, action):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8YQ%3D","line":473,"in_reply_to":"AAAACX%2F%2F8hg%3D","updated":"2011-10-14 18:42:08.000000000","message":"YAGNI","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"3aaec757fe4def61f4e12157e256c82f12205a92","unresolved":false,"context_lines":[{"line_number":470,"context_line":"                            action)"},{"line_number":471,"context_line":"        return response"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":"    def serialize_headers(self, _request, response, data, action):"},{"line_number":474,"context_line":"        self.headers_serializer.serialize(response, data, action)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    def serialize_body(self, request, response, data, content_type, action):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8hg%3D","line":473,"in_reply_to":"AAAACX%2F%2F8ig%3D","updated":"2011-10-13 20:31:06.000000000","message":"Mostly for consistency with serialize_body()--I\u0027m pedantic like that.  I have no problem with removing it.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"5a5c1edba6c5b956cf8b914ea084ad56d0c7024c","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        if data is not None:"},{"line_number":479,"context_line":"            serializer \u003d self.get_body_serializer(content_type)"},{"line_number":480,"context_line":"            if (self.lazy_serialization and"},{"line_number":481,"context_line":"                not isinstance(serializer, JSONDictSerializer)):"},{"line_number":482,"context_line":"                response.body \u003d utils.dumps(data)"},{"line_number":483,"context_line":"                request.environ[\u0027nova.serializer\u0027] \u003d serializer"},{"line_number":484,"context_line":"                request.environ[\u0027nova.action\u0027] \u003d action"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8ic%3D","line":481,"updated":"2011-10-13 20:06:26.000000000","message":"type checking :(","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"638fa55558dc42a92be91720867c2028582c5db7","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        if data is not None:"},{"line_number":479,"context_line":"            serializer \u003d self.get_body_serializer(content_type)"},{"line_number":480,"context_line":"            if (self.lazy_serialization and"},{"line_number":481,"context_line":"                not isinstance(serializer, JSONDictSerializer)):"},{"line_number":482,"context_line":"                response.body \u003d utils.dumps(data)"},{"line_number":483,"context_line":"                request.environ[\u0027nova.serializer\u0027] \u003d serializer"},{"line_number":484,"context_line":"                request.environ[\u0027nova.action\u0027] \u003d action"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8WU%3D","line":481,"in_reply_to":"AAAACX%2F%2F8X8%3D","updated":"2011-10-14 19:13:30.000000000","message":"*nod* chalk it up to premature optimization...","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"602b42b30c1447e979efb12a9442652f19649c50","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        if data is not None:"},{"line_number":479,"context_line":"            serializer \u003d self.get_body_serializer(content_type)"},{"line_number":480,"context_line":"            if (self.lazy_serialization and"},{"line_number":481,"context_line":"                not isinstance(serializer, JSONDictSerializer)):"},{"line_number":482,"context_line":"                response.body \u003d utils.dumps(data)"},{"line_number":483,"context_line":"                request.environ[\u0027nova.serializer\u0027] \u003d serializer"},{"line_number":484,"context_line":"                request.environ[\u0027nova.action\u0027] \u003d action"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8X8%3D","line":481,"in_reply_to":"AAAACX%2F%2F8hc%3D","updated":"2011-10-14 18:42:08.000000000","message":"This would be simpler if we serialized lazily no matter what the content type is.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"3aaec757fe4def61f4e12157e256c82f12205a92","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        if data is not None:"},{"line_number":479,"context_line":"            serializer \u003d self.get_body_serializer(content_type)"},{"line_number":480,"context_line":"            if (self.lazy_serialization and"},{"line_number":481,"context_line":"                not isinstance(serializer, JSONDictSerializer)):"},{"line_number":482,"context_line":"                response.body \u003d utils.dumps(data)"},{"line_number":483,"context_line":"                request.environ[\u0027nova.serializer\u0027] \u003d serializer"},{"line_number":484,"context_line":"                request.environ[\u0027nova.action\u0027] \u003d action"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8hc%3D","line":481,"in_reply_to":"AAAACX%2F%2F8ic%3D","updated":"2011-10-13 20:31:06.000000000","message":"Yeah, I suppose that\u0027s one of the non-Python idioms I\u0027m still in the habit of doing.  I\u0027m not sure how I could tell the difference otherwise, though.\n\nOne option could be to just make JSON serialization the default, and represent it with a serializer of None.  How do you feel about that idea?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"5a5c1edba6c5b956cf8b914ea084ad56d0c7024c","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            raise exception.InvalidContentType(content_type\u003dcontent_type)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"class LazySerializationMiddleware(wsgi.Middleware):"},{"line_number":501,"context_line":"    \"\"\"Lazy serialization middleware.\"\"\""},{"line_number":502,"context_line":"    @webob.dec.wsgify(RequestClass\u003dRequest)"},{"line_number":503,"context_line":"    def __call__(self, req):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8iY%3D","line":500,"updated":"2011-10-13 20:06:26.000000000","message":"One thing that bothers me is that LazySerializationMiddleware appears to be required only if the extensions middleware is enabled. If extensions are not enabled, nobody will be able to get xml output from the api. It seems like this middleware should be lumped into the extensions middleware and the lazy serialization path above should be made dependent on a flag.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"a5425006b4a98d60c5782f623f176628c80a2300","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            raise exception.InvalidContentType(content_type\u003dcontent_type)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"class LazySerializationMiddleware(wsgi.Middleware):"},{"line_number":501,"context_line":"    \"\"\"Lazy serialization middleware.\"\"\""},{"line_number":502,"context_line":"    @webob.dec.wsgify(RequestClass\u003dRequest)"},{"line_number":503,"context_line":"    def __call__(self, req):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8Vk%3D","line":500,"in_reply_to":"AAAACX%2F%2F8V4%3D","updated":"2011-10-14 19:18:05.000000000","message":"Sure, that sounds great. Decoupling always wins in my mind.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"638fa55558dc42a92be91720867c2028582c5db7","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            raise exception.InvalidContentType(content_type\u003dcontent_type)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"class LazySerializationMiddleware(wsgi.Middleware):"},{"line_number":501,"context_line":"    \"\"\"Lazy serialization middleware.\"\"\""},{"line_number":502,"context_line":"    @webob.dec.wsgify(RequestClass\u003dRequest)"},{"line_number":503,"context_line":"    def __call__(self, req):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8V4%3D","line":500,"in_reply_to":"AAAACX%2F%2F8YI%3D","updated":"2011-10-14 19:13:30.000000000","message":"Hmm, a thought just occurred to me.  What if I had the LazySerializationMiddleware add something to the request environment prior to processing the request, which then caused ResponseSerializer to choose lazy serialization?  This would do away with the need for the lazy_serialization tracking needed currently for both Response and ResponseSerializer, and we could remove the LazySerializationMiddleware from the pipeline for 1.0 (assuming 1.0 even exists by that point).  Is that sort of what you\u0027re fishing for?","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"602b42b30c1447e979efb12a9442652f19649c50","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            raise exception.InvalidContentType(content_type\u003dcontent_type)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"class LazySerializationMiddleware(wsgi.Middleware):"},{"line_number":501,"context_line":"    \"\"\"Lazy serialization middleware.\"\"\""},{"line_number":502,"context_line":"    @webob.dec.wsgify(RequestClass\u003dRequest)"},{"line_number":503,"context_line":"    def __call__(self, req):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8YI%3D","line":500,"in_reply_to":"AAAACX%2F%2F8hQ%3D","updated":"2011-10-14 18:42:08.000000000","message":"The middlewares may do different things but they are mutually inclusive. Why would we put this middleware in the 1.0 pipeline? This whole branch is addressing a shortcoming of the extensions implementation, something 1.0 doesn\u0027t care about","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"3aaec757fe4def61f4e12157e256c82f12205a92","unresolved":false,"context_lines":[{"line_number":497,"context_line":"            raise exception.InvalidContentType(content_type\u003dcontent_type)"},{"line_number":498,"context_line":""},{"line_number":499,"context_line":""},{"line_number":500,"context_line":"class LazySerializationMiddleware(wsgi.Middleware):"},{"line_number":501,"context_line":"    \"\"\"Lazy serialization middleware.\"\"\""},{"line_number":502,"context_line":"    @webob.dec.wsgify(RequestClass\u003dRequest)"},{"line_number":503,"context_line":"    def __call__(self, req):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAACX%2F%2F8hQ%3D","line":500,"in_reply_to":"AAAACX%2F%2F8iY%3D","updated":"2011-10-13 20:31:06.000000000","message":"Well, LazySerializationMiddleware does go into the pipeline for the 1.0 API; I wrote this prior to your call to nuke 1.0 from high orbit.  Given the 1.0 removal, the only issue I see with integrating this into ExtensionMiddleware is the conflating of layers; LazySerializationMiddleware and ExtensionMiddleware do completely different things.","commit_id":"147acf23754000241dd0234242a9fd2803e5ac9c"}]}
