)]}'
{"openstack/resource.py":[{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"5a53ece16f4c7b5a40c26f428696d8c168cd9745","unresolved":false,"context_lines":[{"line_number":786,"context_line":"        else:"},{"line_number":787,"context_line":"            assert resp_id \u003d\u003d self.id"},{"line_number":788,"context_line":"        if HEADERS in resp:"},{"line_number":789,"context_line":"            self.set_headers(resp[HEADERS])"},{"line_number":790,"context_line":"        self._reset_dirty()"},{"line_number":791,"context_line":"        return self"},{"line_number":792,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa69d971_677745d5","line":789,"updated":"2015-12-29 23:57:42.000000000","message":"better avoid using the same headers which was designed for requests.","commit_id":"98e942c4c0172e310652256cfe6b1292f76f7450"},{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"9d0f31ed30d77d9588dc2b634610b02e901bda9d","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        if cls.resource_key:"},{"line_number":554,"context_line":"            resp \u003d resp[cls.resource_key]"},{"line_number":555,"context_line":"        if resp_headers:"},{"line_number":556,"context_line":"            resp[HEADERS] \u003d resp_headers"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        return resp"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_bcf9b24f","line":556,"updated":"2015-12-31 02:02:59.000000000","message":"should we consider a deepcopy here?","commit_id":"cf1e479c59e01c9c81eaf013e367633b5d5559a4"},{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"9d0f31ed30d77d9588dc2b634610b02e901bda9d","unresolved":false,"context_lines":[{"line_number":570,"context_line":"        resp \u003d self.create_by_id(session, self._attrs, self.id, path_args\u003dself)"},{"line_number":571,"context_line":"        self._attrs[self.id_attribute] \u003d resp[self.id_attribute]"},{"line_number":572,"context_line":"        if HEADERS in resp:"},{"line_number":573,"context_line":"            self.set_headers({\u0027response_headers\u0027: resp[HEADERS]})"},{"line_number":574,"context_line":"        self._reset_dirty()"},{"line_number":575,"context_line":"        return self"},{"line_number":576,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa69d971_bc7e92ac","line":573,"updated":"2015-12-31 02:02:59.000000000","message":"maybe we should add a dedicated resource attribute instead of the HEADERS? This hack is a little bit dirty for future maintenance.","commit_id":"cf1e479c59e01c9c81eaf013e367633b5d5559a4"},{"author":{"_account_id":1112,"name":"Everett Toews","email":"everett.toews@rackspace.com","username":"everett-toews"},"change_message_id":"a93aa9b392e591405d2c41f9947a7c12c12cf4d5","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    #: Attribute key associated with the name for this resource."},{"line_number":219,"context_line":"    name_attribute \u003d \u0027name\u0027"},{"line_number":220,"context_line":"    #: Attribute key associated with response headers"},{"line_number":221,"context_line":"    response_headers \u003d prop(\u0027response_headers\u0027)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    #: The base part of the url for this resource."},{"line_number":224,"context_line":"    base_path \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_64c20aeb","line":221,"updated":"2016-01-06 19:46:09.000000000","message":"Generic attributes like this are very helpful to users. This is akin to having a response_body. At that point the user is pretty much just interacting with the API directly and the SDK isn\u0027t adding much value.\n\nJust about the only attribute I\u0027d consider including in the Resource base class is location. e.g.\n\n    location \u003d resource.header(\"location\")\n\nEven then I\u0027d require some convincing that it\u0027s used in enough OpenStack APIs to warrant inclusion at this level.\n\nIf there are specific headers that you need exposed, please add them as an attribute to the specific resource classes. e.g. Obj, Account, Container, Server, Whatever. \n\n    thing \u003d resource.header(\"thing\")\n\nThat way they can be documented and easily discoverable by users. That\u0027s a huge part of the value that SDKs add to the developer experience of OpenStack.","commit_id":"48b2115e0a531a9907b708116013a71a38d8593a"},{"author":{"_account_id":1112,"name":"Everett Toews","email":"everett.toews@rackspace.com","username":"everett-toews"},"change_message_id":"40b24f2f0476dc27fe616151ba1e8255e9e6a9a7","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    #: Attribute key associated with the name for this resource."},{"line_number":219,"context_line":"    name_attribute \u003d \u0027name\u0027"},{"line_number":220,"context_line":"    #: Attribute key associated with response headers"},{"line_number":221,"context_line":"    response_headers \u003d prop(\u0027response_headers\u0027)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    #: The base part of the url for this resource."},{"line_number":224,"context_line":"    base_path \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_61e40aac","line":221,"in_reply_to":"fa69d971_56e1a728","updated":"2016-01-07 17:06:51.000000000","message":"There is absolutely nothing confusing about putting anything into resource properties. Quite the opposite. Naming and documenting a property is the best way to expose the domain model to the user. For example,\n\n    #: The secret key value for temporary URLs. If not set,\n    #: this header is not returned by this operation.\n    meta_temp_url_key \u003d resource.header(\"x-account-meta-temp-url-key\")\n\nWithout that header being named and documented, it would be a complete mystery as to what x-account-meta-temp-url-key is for. If x-account-meta-temp-url-key is only returned to users in a response_headers, it\u0027s completely useless to them. They have to go off into the API documentation and try to figure it out themselves. When that happens, the SDK has no value. We can do better.\n\n\nI am aware of the request-id thing but had forgotten about it. Is that one header what this is really all about? I\u0027d be fine considering including it in the Resource as it\u0027s used in many of the OpenStack APIs.\n\n    # some docstring\n    request_id \u003d resource.header(\"x-openstack-request-id\")\n\n\nI agree that swallowing the response headers in SDK is wrong. The answer is do the work to expose them to users properly as documented properties.","commit_id":"48b2115e0a531a9907b708116013a71a38d8593a"},{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"6c3f27ff49a6ed426586409cabf0b6c5e47444a1","unresolved":false,"context_lines":[{"line_number":218,"context_line":"    #: Attribute key associated with the name for this resource."},{"line_number":219,"context_line":"    name_attribute \u003d \u0027name\u0027"},{"line_number":220,"context_line":"    #: Attribute key associated with response headers"},{"line_number":221,"context_line":"    response_headers \u003d prop(\u0027response_headers\u0027)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"    #: The base part of the url for this resource."},{"line_number":224,"context_line":"    base_path \u003d \u0027\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa69d971_56e1a728","line":221,"in_reply_to":"fa69d971_64c20aeb","updated":"2016-01-07 06:46:16.000000000","message":"@Everett, I think you are also aware of the request-id thing, though not always required, it has been requested by quite some users.\n\nSqueezing these things into resource properties will be confusing. Not sure if we should revise Resource class as suggested by this spec? http://git.openstack.org/cgit/openstack/openstack-specs/tree/specs/return-request-id.rst\n\nI agree that it is not used in enough OpenStack APIs today.  There are always a lot cross-project consensus to achieve. But anyway, swallowing the response headers in SDK is wrong. Exposing them into each resource type as resource properties is not correct either.","commit_id":"48b2115e0a531a9907b708116013a71a38d8593a"},{"author":{"_account_id":8246,"name":"Qiming Teng","email":"tengqm@outlook.com","username":"tengqm"},"change_message_id":"abaeabe5bb1e63fd6b4e84a8d4b6e6eacfea0770","unresolved":false,"context_lines":[{"line_number":549,"context_line":"            resp \u003d session.put(url, endpoint_filter\u003dcls.service, **args)"},{"line_number":550,"context_line":"        else:"},{"line_number":551,"context_line":"            resp \u003d session.post(url, endpoint_filter\u003dcls.service, **args)"},{"line_number":552,"context_line":"        resp_headers \u003d resp.headers"},{"line_number":553,"context_line":"        resp \u003d resp.json()"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"        if cls.resource_key:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_d9d00d56","line":552,"updated":"2016-01-13 08:48:42.000000000","message":"after adding line 220-221, do we still need this and the following changes?","commit_id":"c58a9f4d8577a684b1a022541de6bc0534333acb"},{"author":{"_account_id":7404,"name":"Ethan Lynn","email":"xuanlangjian@gmail.com","username":"GaryLynn"},"change_message_id":"143a4a16f1afa864590a9fd7497132075c04b2e6","unresolved":false,"context_lines":[{"line_number":549,"context_line":"            resp \u003d session.put(url, endpoint_filter\u003dcls.service, **args)"},{"line_number":550,"context_line":"        else:"},{"line_number":551,"context_line":"            resp \u003d session.post(url, endpoint_filter\u003dcls.service, **args)"},{"line_number":552,"context_line":"        resp_headers \u003d resp.headers"},{"line_number":553,"context_line":"        resp \u003d resp.json()"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"        if cls.resource_key:"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_c7ceac2d","line":552,"in_reply_to":"da6ed579_d9d00d56","updated":"2016-01-14 05:17:30.000000000","message":"Yes, we still need to pass headers from this function to create() at Line574, then set location to headers. Otherwise we cant get \u0027location\u0027 from create or update.","commit_id":"c58a9f4d8577a684b1a022541de6bc0534333acb"}]}
