)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     haobing1 \u003chao.bing1@zte.com.cn\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-06-12 09:15:15 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Allow remove description and name for consisgroup"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change allow API user to remove the consistency group name"},{"line_number":10,"context_line":"or description information."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":11,"id":"7aa08908_daf2566e","line":7,"updated":"2016-06-14 19:29:48.000000000","message":"Maybe\n\n\"allow setting CG name or description to empty value\"\n\nis a little more specific.","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"}],"cinder/api/contrib/consistencygroups.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"4dbe03ece453d53285401f962096ba0c396e1321","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        self.assert_valid_body(body, \u0027consistencygroup\u0027)"},{"line_number":267,"context_line":"        context \u003d req.environ[\u0027cinder.context\u0027]"},{"line_number":268,"context_line":"        (name, description, add_volumes, remove_volumes) \u003d \\"},{"line_number":269,"context_line":"            self._check_update_parameters(body)"},{"line_number":270,"context_line":"        self._update(context, id, name, description, add_volumes,"},{"line_number":271,"context_line":"                     remove_volumes)"},{"line_number":272,"context_line":"        return webob.Response(status_int\u003d202)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_86c9ec28","line":269,"updated":"2016-06-07 22:18:41.000000000","message":"name, description, add_volumes, remove_volumes \u003d (\n            self._check_update_parameters(body))","commit_id":"c148ab0cb0fa76517c13394041020c73802ff744"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"41a086c004118e01300534c9b913c858fe0b22ad","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":217,"context_line":"                    \"can not be all empty in the request body.\")"},{"line_number":218,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":219,"context_line":"        return (name, description, add_volumes, remove_volumes)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def _update(self, context, id, name, description, add_volumes,"},{"line_number":222,"context_line":"                remove_volumes,"}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_61a09ca6","line":219,"updated":"2016-06-09 20:03:32.000000000","message":"nit: No need to use parenthesis.","commit_id":"cd9ca6ac816905561308f57c74a5445bb1a86b60"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        LOG.info(_LI(\"Updating consistency group %(id)s with name %(name)s \""},{"line_number":225,"context_line":"                     \"description: %(description)s add_volumes: \""},{"line_number":226,"context_line":"                     \"%(add_volumes)s remove_volumes: %(remove_volumes)s.\"),"},{"line_number":227,"context_line":"                 {\u0027id\u0027: id, \u0027name\u0027: name,"},{"line_number":228,"context_line":"                  \u0027description\u0027: description,"},{"line_number":229,"context_line":"                  \u0027add_volumes\u0027: add_volumes,"},{"line_number":230,"context_line":"                  \u0027remove_volumes\u0027: remove_volumes},"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_ba182a1f","line":227,"range":{"start_line":227,"start_character":29,"end_line":227,"end_character":33},"updated":"2016-06-14 19:29:48.000000000","message":"This should be on it\u0027s own line. This whole dictionary should probably be specified in a variable first then passed into LOG.info.","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        self.assert_valid_body(body, \u0027consistencygroup\u0027)"},{"line_number":267,"context_line":"        context \u003d req.environ[\u0027cinder.context\u0027]"},{"line_number":268,"context_line":"        name, description, add_volumes, remove_volumes \u003d ("},{"line_number":269,"context_line":"            self._check_update_parameters(body))"},{"line_number":270,"context_line":"        self._update(context, id, name, description, add_volumes,"},{"line_number":271,"context_line":"                     remove_volumes)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_7a740267","line":268,"updated":"2016-06-14 19:29:48.000000000","message":"I dont think _check_update_parameters should return anything, especially not a tuple with 4 items. Just grab them from the body again.","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e97292a9bb4ae9d13aad4ae0fcc8e33a036ed659","unresolved":false,"context_lines":[{"line_number":211,"context_line":"        name \u003d consistencygroup.get(\u0027name\u0027, None)"},{"line_number":212,"context_line":"        description \u003d consistencygroup.get(\u0027description\u0027, None)"},{"line_number":213,"context_line":"        add_volumes \u003d consistencygroup.get(\u0027add_volumes\u0027, None)"},{"line_number":214,"context_line":"        remove_volumes \u003d consistencygroup.get(\u0027remove_volumes\u0027, None)"},{"line_number":215,"context_line":"        if not (name or description or add_volumes or remove_volumes):"},{"line_number":216,"context_line":"            msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":217,"context_line":"                    \"can not be all empty in the request body.\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_ec171543","line":214,"updated":"2016-06-17 03:03:43.000000000","message":"I just realized that you are getting these parameters from the body in both here and under api/v3.  Somehow I thought it is only done in one place.\n\nIn that case, I think it makes sense to move these out of this function and call them in update() instead.","commit_id":"089491e00610d83cf3c05b5e51ff611f1650c656"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e97292a9bb4ae9d13aad4ae0fcc8e33a036ed659","unresolved":false,"context_lines":[{"line_number":216,"context_line":"            msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":217,"context_line":"                    \"can not be all empty in the request body.\")"},{"line_number":218,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":219,"context_line":"        return (name, description, add_volumes, remove_volumes)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def _update(self, context, id, name, description, add_volumes,"},{"line_number":222,"context_line":"                remove_volumes,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_6c284534","line":219,"updated":"2016-06-17 03:03:43.000000000","message":"You don\u0027t need to return anything after the change.","commit_id":"089491e00610d83cf3c05b5e51ff611f1650c656"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e97292a9bb4ae9d13aad4ae0fcc8e33a036ed659","unresolved":false,"context_lines":[{"line_number":265,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":266,"context_line":""},{"line_number":267,"context_line":"        self.assert_valid_body(body, \u0027consistencygroup\u0027)"},{"line_number":268,"context_line":"        context \u003d req.environ[\u0027cinder.context\u0027]"},{"line_number":269,"context_line":"        (name, description, add_volumes, remove_volumes) \u003d ("},{"line_number":270,"context_line":"            self._assert_valid_update_body(body))"},{"line_number":271,"context_line":"        self._update(context, id, name, description, add_volumes,"}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_0c4b815a","line":268,"updated":"2016-06-17 03:03:43.000000000","message":"Move the following to update():\n        consistencygroup \u003d body.get(\u0027consistencygroup\u0027, None)\n        self.validate_name_and_description(consistencygroup)\n        name \u003d consistencygroup.get(\u0027name\u0027, None)\n        description \u003d consistencygroup.get(\u0027description\u0027, None)\n        add_volumes \u003d consistencygroup.get(\u0027add_volumes\u0027, None)\n        remove_volumes \u003d consistencygroup.get(\u0027remove_volumes\u0027, None)\n\nKeep the following in _check_update_parameters (I like the old name better):\n\ndef _check_update_parameters(self, name, description, add_volumes, remove_volumes):\n\n        if not (name or description or add_volumes or remove_volumes):\n            msg \u003d _(\"Name, description, add_volumes, and remove_volumes \"\n                    \"can not be all empty in the request body.\")\n            raise exc.HTTPBadRequest(explanation\u003dmsg)","commit_id":"089491e00610d83cf3c05b5e51ff611f1650c656"}],"cinder/api/openstack/rest_api_version_history.rst":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e642731c839f9730e4ded943a6977ed94079c0b0","unresolved":false,"context_lines":[{"line_number":67,"context_line":""},{"line_number":68,"context_line":"3.6"},{"line_number":69,"context_line":"---"},{"line_number":70,"context_line":"  Allows to set empty description and empty name for consistency"},{"line_number":71,"context_line":"  group in consisgroup-update operation."}],"source_content_type":"text/x-rst","patch_set":5,"id":"7aa08908_86cb2972","line":70,"updated":"2016-06-06 03:55:48.000000000","message":"s/Allows/Allowed","commit_id":"526af165b4b38986c87675c1b2b804f078f649f1"}],"cinder/api/v3/consistencygroups.py":[{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"e80c6a9ef15a9cce9f1aba0baa68d58b99aba6cc","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        description \u003d consistencygroup.get(\u0027description\u0027, None)"},{"line_number":62,"context_line":"        add_volumes \u003d consistencygroup.get(\u0027add_volumes\u0027, None)"},{"line_number":63,"context_line":"        remove_volumes \u003d consistencygroup.get(\u0027remove_volumes\u0027, None)"},{"line_number":64,"context_line":"        if req.api_version_request.matches(\u00273.6\u0027, None):"},{"line_number":65,"context_line":"            if (name is None and description is None"},{"line_number":66,"context_line":"                    and not add_volumes and not remove_volumes):"},{"line_number":67,"context_line":"                msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":68,"context_line":"                        \"can not be all empty in the request body.\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_df404738","line":65,"range":{"start_line":64,"start_character":8,"end_line":65,"end_character":52},"updated":"2016-06-02 17:21:12.000000000","message":"strict \u003d req.api_version_request.matches(\u00273.6\u0027, None)\nif strict:            \n    if (name is None and description is None\n\n\n-\n* \u0027None\u0027 can be removed in api_version_check.","commit_id":"17c4c2e9721e8a888568a412bbc73b9f31e185e3"},{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"e80c6a9ef15a9cce9f1aba0baa68d58b99aba6cc","unresolved":false,"context_lines":[{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        try:"},{"line_number":86,"context_line":"            group \u003d self.consistencygroup_api.get(context, id)"},{"line_number":87,"context_line":"            self.consistencygroup_api.update("},{"line_number":88,"context_line":"                context, group, name, description,"},{"line_number":89,"context_line":"                add_volumes, remove_volumes)"},{"line_number":90,"context_line":"        except exception.ConsistencyGroupNotFound as error:"},{"line_number":91,"context_line":"            raise exc.HTTPNotFound(explanation\u003derror.msg)"},{"line_number":92,"context_line":"        except exception.InvalidConsistencyGroup as error:"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_1f62cfd8","line":89,"range":{"start_line":87,"start_character":12,"end_line":89,"end_character":44},"updated":"2016-06-02 17:21:12.000000000","message":"self.consistencygroup_api.update(\n                context, group, name, description,\n                add_volumes, remove_volumes, strict)","commit_id":"17c4c2e9721e8a888568a412bbc73b9f31e185e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e642731c839f9730e4ded943a6977ed94079c0b0","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        except exception.InvalidConsistencyGroup as error:"},{"line_number":94,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.msg)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        return webob.Response(status_int\u003d202)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"def create_resource():"}],"source_content_type":"text/x-python","patch_set":5,"id":"7aa08908_26c7d513","line":96,"updated":"2016-06-06 03:55:48.000000000","message":"This is a complete copy of consisgroup_update.  This will make future maintenance difficult.  I think we should make the common part of the function into a separate function in api/contrib.  Then here we check the version and call the common function.","commit_id":"526af165b4b38986c87675c1b2b804f078f649f1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"6a8943505c760c6b40eeb33e6b647eb640e7010b","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            raise exc.HTTPBadRequest(explanation\u003derror.msg)"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        return webob.Response(status_int\u003d202)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def create_resource():"},{"line_number":93,"context_line":"    return wsgi.Resource(ConsistencyGroupsController())"}],"source_content_type":"text/x-python","patch_set":7,"id":"7aa08908_f4d417be","line":90,"updated":"2016-06-07 04:55:13.000000000","message":"This still has lots of redundant code in here and in api/contrib.  Here is my suggestion:\n\n- Create a _check_params() function in api/contrib/consistencygroups.py which checks if name is valid, etc.\n- Create a _check_params() function here which overrides the one in contrib and it checks the version and if name is valid, etc.\n- Create an _update() method in api/contrib/consistencygroups.py which does everything, including calling the _check_parame() function.\n- In update() in api/contrib/consistencygroups.py, call _update().\n- In update() here, call _update().","commit_id":"333cf0417ec93d4e58483344d86b7b4d21aeb1a2"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"4dbe03ece453d53285401f962096ba0c396e1321","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        self.assert_valid_body(body, \u0027consistencygroup\u0027)"},{"line_number":75,"context_line":"        context \u003d req.environ[\u0027cinder.context\u0027]"},{"line_number":76,"context_line":"        (name, description, add_volumes, remove_volumes, allow_empty) \u003d \\"},{"line_number":77,"context_line":"            self._check_update_parameters(req, body)"},{"line_number":78,"context_line":"        self._update(context, id, name, description, add_volumes,"},{"line_number":79,"context_line":"                     remove_volumes, allow_empty)"},{"line_number":80,"context_line":"        return webob.Response(status_int\u003d202)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_4680a48b","line":77,"updated":"2016-06-07 22:18:41.000000000","message":"name, description, add_volumes, remove_volumes, allow_empty \u003d (\n            self._check_update_parameters(req, body))","commit_id":"c148ab0cb0fa76517c13394041020c73802ff744"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"41a086c004118e01300534c9b913c858fe0b22ad","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":47,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":48,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":49,"context_line":"        return (name, description, add_volumes, remove_volumes, allow_empty)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def update(self, req, id, body):"},{"line_number":52,"context_line":"        \"\"\"Update the consistency group."}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_a1dc4447","line":49,"updated":"2016-06-09 20:03:32.000000000","message":"nit: No need to use parenthesis.","commit_id":"cd9ca6ac816905561308f57c74a5445bb1a86b60"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":17,"context_line":"import webob"},{"line_number":18,"context_line":"from webob import exc"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"from cinder.api.contrib import consistencygroups as consisgrp_v2"},{"line_number":21,"context_line":"from cinder.api.openstack import wsgi"},{"line_number":22,"context_line":"from cinder.i18n import _"},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_9aa3ae42","line":20,"range":{"start_line":20,"start_character":52,"end_line":20,"end_character":64},"updated":"2016-06-14 19:29:48.000000000","message":"minor nit, but I rather have cg_v2 or spell out consistency_groups_v2.","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        if allow_empty:"},{"line_number":39,"context_line":"            if (name is None and description is None"},{"line_number":40,"context_line":"                    and not add_volumes and not remove_volumes):"},{"line_number":41,"context_line":"                msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":42,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":43,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":44,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_ba2dcaa9","line":41,"updated":"2016-06-14 19:29:48.000000000","message":"I would prefer that it says \"Must specify one or more of the following keys to update: name, description, add_volumes, remove_volumes\"","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":43,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":44,"context_line":"        else:"},{"line_number":45,"context_line":"            if not (name or description or add_volumes or remove_volumes):"},{"line_number":46,"context_line":"                msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":47,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":48,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_3558cb30","line":45,"updated":"2016-06-14 19:29:48.000000000","message":"I understand this is added here for supporting previous microversions but I wonder if we need to support the old behavior if it was a bug. I imagine this will make the code base very cluttered, for example, this is a brand new file and we already have this if logic.","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"43e8ac35496758d13215a767e9f8920f781d7a8d","unresolved":false,"context_lines":[{"line_number":42,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":43,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":44,"context_line":"        else:"},{"line_number":45,"context_line":"            if not (name or description or add_volumes or remove_volumes):"},{"line_number":46,"context_line":"                msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":47,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":48,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_4c2aa9e8","line":45,"in_reply_to":"7aa08908_3558cb30","updated":"2016-06-17 03:07:58.000000000","message":"I know it sounds silly but this is really a tiny enhancement rather than a bug because it worked as designed. So I\u0027d prefer keep the existing API behavior for older microversion.  We have microversion now to make it happen.","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":47,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":48,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":49,"context_line":"        return name, description, add_volumes, remove_volumes, allow_empty"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def update(self, req, id, body):"},{"line_number":52,"context_line":"        \"\"\"Update the consistency group."}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_1584af5b","line":49,"updated":"2016-06-14 19:29:48.000000000","message":"Same comment as other controller, I dont think this function should return these. Also, maybe it should be called \u0027assert_valid_update_body\u0027 or something to follow the convention set forth by \u0027assert_valid_body\u0027","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e97292a9bb4ae9d13aad4ae0fcc8e33a036ed659","unresolved":false,"context_lines":[{"line_number":33,"context_line":"        name \u003d consistencygroup.get(\u0027name\u0027, None)"},{"line_number":34,"context_line":"        description \u003d consistencygroup.get(\u0027description\u0027, None)"},{"line_number":35,"context_line":"        add_volumes \u003d consistencygroup.get(\u0027add_volumes\u0027, None)"},{"line_number":36,"context_line":"        remove_volumes \u003d consistencygroup.get(\u0027remove_volumes\u0027, None)"},{"line_number":37,"context_line":"        allow_empty \u003d req.api_version_request.matches(\u00273.6\u0027, None)"},{"line_number":38,"context_line":"        if allow_empty:"},{"line_number":39,"context_line":"            if (name is None and description is None"}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_2c391da4","line":36,"updated":"2016-06-17 03:03:43.000000000","message":"Same suggestion here.  Move lines #31-36 to update().  Keep the following in this function.  Rename it to _check_update_parameters_v3.\n\ndef _check_update_parameters_v3(self, req, name, description, add_volumes, remove_volumes)\n\nI added a \"_v3\" because this function has an extra input parameter \"req\" compared to the one under api/contrib.","commit_id":"089491e00610d83cf3c05b5e51ff611f1650c656"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e97292a9bb4ae9d13aad4ae0fcc8e33a036ed659","unresolved":false,"context_lines":[{"line_number":40,"context_line":"                    and not add_volumes and not remove_volumes):"},{"line_number":41,"context_line":"                msg \u003d _(\"Must specify one or more of the following keys to \""},{"line_number":42,"context_line":"                        \"update: name, description, \""},{"line_number":43,"context_line":"                        \"add_volumes, remove_volumes\")"},{"line_number":44,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":45,"context_line":"        else:"},{"line_number":46,"context_line":"            if not (name or description or add_volumes or remove_volumes):"}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_21776603","line":43,"updated":"2016-06-17 03:03:43.000000000","message":"Add a period at the end.","commit_id":"089491e00610d83cf3c05b5e51ff611f1650c656"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e97292a9bb4ae9d13aad4ae0fcc8e33a036ed659","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                msg \u003d _(\"Name, description, add_volumes, and remove_volumes \""},{"line_number":48,"context_line":"                        \"can not be all empty in the request body.\")"},{"line_number":49,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":50,"context_line":"        return (name, description, add_volumes, remove_volumes, allow_empty)"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    def update(self, req, id, body):"},{"line_number":53,"context_line":"        \"\"\"Update the consistency group."}],"source_content_type":"text/x-python","patch_set":12,"id":"7aa08908_ac9d0d59","line":50,"updated":"2016-06-17 03:03:43.000000000","message":"No need to return anything after the change.","commit_id":"089491e00610d83cf3c05b5e51ff611f1650c656"}],"cinder/api/v3/router.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"4dbe03ece453d53285401f962096ba0c396e1321","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                       conditions\u003d{\"method\": [\u0027PUT\u0027]})"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        self.resources[\u0027consistencygroups\u0027] \u003d \\"},{"line_number":104,"context_line":"            consistencygroups.create_resource()"},{"line_number":105,"context_line":"        mapper.resource(\"consistencygroup\", \"consistencygroups\","},{"line_number":106,"context_line":"                        controller\u003dself.resources[\u0027consistencygroups\u0027],"},{"line_number":107,"context_line":"                        member\u003d{\u0027update\u0027: \u0027PUT\u0027})"}],"source_content_type":"text/x-python","patch_set":8,"id":"7aa08908_e1125a56","line":104,"updated":"2016-06-07 22:18:41.000000000","message":"Use () to replace \\","commit_id":"c148ab0cb0fa76517c13394041020c73802ff744"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"41a086c004118e01300534c9b913c858fe0b22ad","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                       action\u003d\u0027update_all\u0027,"},{"line_number":101,"context_line":"                       conditions\u003d{\"method\": [\u0027PUT\u0027]})"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        self.resources[\u0027consistencygroups\u0027] \u003d \\"},{"line_number":104,"context_line":"            consistencygroups.create_resource()"},{"line_number":105,"context_line":"        mapper.resource(\"consistencygroup\", \"consistencygroups\","},{"line_number":106,"context_line":"                        controller\u003dself.resources[\u0027consistencygroups\u0027],"},{"line_number":107,"context_line":"                        member\u003d{\u0027update\u0027: \u0027PUT\u0027})"}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_dbafc329","line":104,"range":{"start_line":103,"start_character":8,"end_line":104,"end_character":47},"updated":"2016-06-09 20:03:32.000000000","message":"nit: Please use () to replace \\:\n \nself.resources[\u0027consistencygroups\u0027] \u003d (\n            consistencygroups.create_resource())","commit_id":"cd9ca6ac816905561308f57c74a5445bb1a86b60"}],"cinder/consistencygroup/api.py":[{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"e80c6a9ef15a9cce9f1aba0baa68d58b99aba6cc","unresolved":false,"context_lines":[{"line_number":498,"context_line":""},{"line_number":499,"context_line":"        # Update name and description in db now. No need to"},{"line_number":500,"context_line":"        # to send them over through an RPC call."},{"line_number":501,"context_line":"        if name is not None:"},{"line_number":502,"context_line":"            fields[\u0027name\u0027] \u003d name"},{"line_number":503,"context_line":"        if description is not None:"},{"line_number":504,"context_line":"            fields[\u0027description\u0027] \u003d description"},{"line_number":505,"context_line":""},{"line_number":506,"context_line":"        # NOTE(geguileo): We will use the updating status in the CG as a lock"},{"line_number":507,"context_line":"        # mechanism to prevent volume add/remove races with other API, while we"}],"source_content_type":"text/x-python","patch_set":2,"id":"9abb7d3a_b4ac8a36","line":504,"range":{"start_line":501,"start_character":0,"end_line":504,"end_character":47},"updated":"2016-06-02 17:21:12.000000000","message":"Code seems good.\nI see only one issue here, kindly add api-version check here for update behavior.\nMay be you can add default boolean argument here in update function and depending upon value of that variable seperate existing and updated functionality.\n\nFor ex,\ndef update(self, context, group, name, description,\n           add_volumes, remove_volumes, strict\u003dFalse):\n\nif strict:\n    # updated code\n    if name is not None:\n        fields[\u0027name\u0027] \u003d name\n    if description is not None:\n        fields[\u0027description\u0027] \u003d description\nelse:\n    # existing code\n    if name:\n        fields[\u0027name\u0027] \u003d name\n    if description:\n        fields[\u0027description\u0027] \u003d description\n\nIn same way pass strict variable to _check_update function as well.\n\nself._check_update(group, name, description, add_volumes,\n                   remove_volumes, strict)\n\nand handle accordingly\ndef _check_update(self, group, name, description,      add_volumes,remove_volumes, strict\u003dFalse):","commit_id":"17c4c2e9721e8a888568a412bbc73b9f31e185e3"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e642731c839f9730e4ded943a6977ed94079c0b0","unresolved":false,"context_lines":[{"line_number":453,"context_line":"        self.volume_rpcapi.delete_consistencygroup(context, group)"},{"line_number":454,"context_line":""},{"line_number":455,"context_line":"    def _check_update(self, group, name, description, add_volumes,"},{"line_number":456,"context_line":"                      remove_volumes, strict\u003dFalse):"},{"line_number":457,"context_line":"        if strict:"},{"line_number":458,"context_line":"            if (name is None and description is None"},{"line_number":459,"context_line":"                    and not add_volumes and not remove_volumes):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7aa08908_6641dd0b","line":456,"updated":"2016-06-06 03:55:48.000000000","message":"What does \"strict\" mean here?  It seems to me that not to allow empty name is more strict.  I suggest change this parameter to something like \"allow_empty\".","commit_id":"526af165b4b38986c87675c1b2b804f078f649f1"},{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"cf2cb6e6916fe336de948c94d74fbd170bae986a","unresolved":false,"context_lines":[{"line_number":499,"context_line":"        if description \u003d\u003d group.description:"},{"line_number":500,"context_line":"            description \u003d None"},{"line_number":501,"context_line":"        self._check_update(group, name, description, add_volumes,"},{"line_number":502,"context_line":"                           remove_volumes, strict\u003dTrue)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        fields \u003d {\u0027updated_at\u0027: timeutils.utcnow()}"},{"line_number":505,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7aa08908_264d1573","line":502,"range":{"start_line":502,"start_character":43,"end_line":502,"end_character":54},"updated":"2016-06-06 03:22:33.000000000","message":"This should be -strict- only as strict is already initialized in update()..","commit_id":"526af165b4b38986c87675c1b2b804f078f649f1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"e642731c839f9730e4ded943a6977ed94079c0b0","unresolved":false,"context_lines":[{"line_number":499,"context_line":"        if description \u003d\u003d group.description:"},{"line_number":500,"context_line":"            description \u003d None"},{"line_number":501,"context_line":"        self._check_update(group, name, description, add_volumes,"},{"line_number":502,"context_line":"                           remove_volumes, strict\u003dTrue)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        fields \u003d {\u0027updated_at\u0027: timeutils.utcnow()}"},{"line_number":505,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7aa08908_260515c2","line":502,"range":{"start_line":502,"start_character":43,"end_line":502,"end_character":54},"in_reply_to":"7aa08908_264d1573","updated":"2016-06-06 03:55:48.000000000","message":"+1","commit_id":"526af165b4b38986c87675c1b2b804f078f649f1"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"41a086c004118e01300534c9b913c858fe0b22ad","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                                   c_fields.ConsistencyGroupStatus.ERROR)}"},{"line_number":435,"context_line":"        filters \u003d [~db.cg_has_cgsnapshot_filter(),"},{"line_number":436,"context_line":"                   ~db.cg_has_volumes_filter(attached_or_with_snapshots\u003dforce),"},{"line_number":437,"context_line":"                   ~db.cg_creating_from_src(cg_id\u003dgroup.id)]"},{"line_number":438,"context_line":"        values \u003d {\u0027status\u0027: c_fields.ConsistencyGroupStatus.DELETING}"},{"line_number":439,"context_line":""},{"line_number":440,"context_line":"        if not group.conditional_update(values, expected, filters):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7aa08908_a140c408","line":437,"updated":"2016-06-09 20:03:32.000000000","message":"This is old code.  I\u0027m still getting \"DBError: (pymysql.err.InternalError) (1093, u\"You can\u0027t specify target table \u0027consistencygroups\u0027 for update in FROM clause\")\" when doing \"cinder consisgroup-update --add-volumes xxxx --remove-volumes\".\n\nPlease do a rebase.  I don\u0027t feel comfortable merging this patch when I get DB error doing consisgroup-update.  Although the error is not caused by your patch, I\u0027ll get this error whenever I test consisgroup-update which you changed.","commit_id":"cd9ca6ac816905561308f57c74a5445bb1a86b60"},{"author":{"_account_id":177,"name":"Alex Meade","email":"mr.alex.meade@gmail.com","username":"alex-meade"},"change_message_id":"04b7f5aa134e03604921a961fd8bb29bb4f95b75","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        # Validate description."},{"line_number":499,"context_line":"        if description \u003d\u003d group.description:"},{"line_number":500,"context_line":"            description \u003d None"},{"line_number":501,"context_line":"        self._check_update(group, name, description, add_volumes,"},{"line_number":502,"context_line":"                           remove_volumes, allow_empty)"},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"        fields \u003d {\u0027updated_at\u0027: timeutils.utcnow()}"}],"source_content_type":"text/x-python","patch_set":11,"id":"7aa08908_d56a2780","line":501,"updated":"2016-06-14 19:29:48.000000000","message":"Did this every provide any functional value since they API layer always checks this first? Perhaps we can remove this function with no change in behavior.","commit_id":"2d84378e251f8bde937a95f26045a46ea829afa0"}],"cinder/tests/unit/api/v3/test_consistencygroups.py":[{"author":{"_account_id":16308,"name":"Sheel Rana","email":"ranasheel2000@gmail.com","username":"sheel.rana"},"change_message_id":"e80c6a9ef15a9cce9f1aba0baa68d58b99aba6cc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"9abb7d3a_bf47431c","line":89,"updated":"2016-06-02 17:21:12.000000000","message":"Add test for version other than 3.6 as well to check results for invalid version like 3.5.","commit_id":"17c4c2e9721e8a888568a412bbc73b9f31e185e3"}]}
