)]}'
{"cinder/api/v1/volumes.py":[{"author":{"_account_id":10559,"name":"Steven Kaufer","email":"kaufer@us.ibm.com","username":"kaufer"},"change_message_id":"873c9f6a90dbdfb712f78be25fcaded47ed25346","unresolved":false,"context_lines":[{"line_number":282,"context_line":"                                          sort_keys\u003d[\u0027created_at\u0027],"},{"line_number":283,"context_line":"                                          sort_dirs\u003d[\u0027desc\u0027],"},{"line_number":284,"context_line":"                                          filters\u003dsearch_opts,"},{"line_number":285,"context_line":"                                          viewable_admin_meta\u003dTrue)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"        volumes \u003d [dict(vol.iteritems()) for vol in volumes]"},{"line_number":288,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a961159_0a123362","line":285,"updated":"2014-12-16 16:57:02.000000000","message":"Note that this change is required since the volume API signature has changed (replacing \u0027sort_key\u0027 and \u0027sort_dir\u0027 with \u0027sort_keys\u0027 and \u0027sort_dirs\u0027). This change will not affect the v1 API functionality.","commit_id":"1bbcc1f844bc998a69c71406e55d39d99a35ae0c"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"97f93dd493e7562db6b1d314802424a963348de0","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    def _items(self, req, entity_maker):"},{"line_number":266,"context_line":"        \"\"\"Returns a list of volumes, transformed through entity_maker.\"\"\""},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        # pop out limit and offset , they are not search_opts"},{"line_number":269,"context_line":"        search_opts \u003d req.GET.copy()"},{"line_number":270,"context_line":"        search_opts.pop(\u0027limit\u0027, None)"},{"line_number":271,"context_line":"        search_opts.pop(\u0027offset\u0027, None)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_3d9fa004","line":268,"updated":"2015-02-25 18:58:47.000000000","message":"Why is this change still in here?","commit_id":"a176378361744aecaa8287ed4ca7e7c5fb6ba03f"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"fe6c3f9a3ae67cded1dc7cbc348e447201535d13","unresolved":false,"context_lines":[{"line_number":265,"context_line":"    def _items(self, req, entity_maker):"},{"line_number":266,"context_line":"        \"\"\"Returns a list of volumes, transformed through entity_maker.\"\"\""},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        # pop out limit and offset , they are not search_opts"},{"line_number":269,"context_line":"        search_opts \u003d req.GET.copy()"},{"line_number":270,"context_line":"        search_opts.pop(\u0027limit\u0027, None)"},{"line_number":271,"context_line":"        search_opts.pop(\u0027offset\u0027, None)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_a0f7e7d1","line":268,"in_reply_to":"ba7be1f8_3d9fa004","updated":"2015-02-25 19:05:11.000000000","message":"Nevermind.","commit_id":"a176378361744aecaa8287ed4ca7e7c5fb6ba03f"}],"cinder/api/v2/volumes.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"93c7c7f225b3e36d413086e6ce3d50f4639c40d6","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            except (ValueError, SyntaxError):"},{"line_number":236,"context_line":"                LOG.debug(\u0027Could not evaluate value %s, assuming string\u0027, v)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        volumes \u003d self.volume_api.get_all(context, marker, limit,"},{"line_number":239,"context_line":"                                          sort_keys\u003dsort_keys,"},{"line_number":240,"context_line":"                                          sort_dirs\u003dsort_dirs,"},{"line_number":241,"context_line":"                                          filters\u003dfilters,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_e97343e5","line":238,"updated":"2015-02-20 12:16:31.000000000","message":"If I didn\u0027t miss anything, this call could raise exception. InvalidInput and 500 error will be returned to API user instead of webob.exc.HTTPBadRequest. It\u0027s not acceptable for the API to return 500 server error instead of 4xx.\n\n5xx means that something went wrong and we can\u0027t handle it in any way.","commit_id":"f5edd74b515e6018372a913e174a4761faa32b58"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"88c65570cb5191aa8a01a4dd4935506e28089e7c","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            except (ValueError, SyntaxError):"},{"line_number":236,"context_line":"                LOG.debug(\u0027Could not evaluate value %s, assuming string\u0027, v)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        volumes \u003d self.volume_api.get_all(context, marker, limit,"},{"line_number":239,"context_line":"                                          sort_keys\u003dsort_keys,"},{"line_number":240,"context_line":"                                          sort_dirs\u003dsort_dirs,"},{"line_number":241,"context_line":"                                          filters\u003dfilters,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_2daf19e5","line":238,"in_reply_to":"ba7be1f8_9a520012","updated":"2015-02-20 17:08:38.000000000","message":"Steven, thanks for the detailed response. I missed that raising exception.InvalidInput would return 400 code.","commit_id":"f5edd74b515e6018372a913e174a4761faa32b58"},{"author":{"_account_id":10559,"name":"Steven Kaufer","email":"kaufer@us.ibm.com","username":"kaufer"},"change_message_id":"491bd4fd035409ecff689c5cd0e281e07817fcf1","unresolved":false,"context_lines":[{"line_number":235,"context_line":"            except (ValueError, SyntaxError):"},{"line_number":236,"context_line":"                LOG.debug(\u0027Could not evaluate value %s, assuming string\u0027, v)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        volumes \u003d self.volume_api.get_all(context, marker, limit,"},{"line_number":239,"context_line":"                                          sort_keys\u003dsort_keys,"},{"line_number":240,"context_line":"                                          sort_dirs\u003dsort_dirs,"},{"line_number":241,"context_line":"                                          filters\u003dfilters,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_9a520012","line":238,"in_reply_to":"ba7be1f8_e97343e5","updated":"2015-02-20 15:22:26.000000000","message":"Ivan, where in the code do you see these exceptions being raised? As far as I can tell, these are the possible error cases:\n\n- Invalid sort key: The code here [1] raises an exception.InvalidInput if a sort key is not on the model.\n\n- Invalid sort direction:  The code here [2] would raise a ValueError for this case (would would result in a 500 error) so I added a check in the dependent change set to instead raise an exception.InvalidInput in this case [3].\n\n- More sort directions than sort keys:  Also handled in [3], an exception.InvalidInput is raised.\n\nThe InvalidInput exception has a 400 error code [4].\n\n[1]  https://github.com/openstack/cinder/blob/master/cinder/common/sqlalchemyutils.py#L91\n\n[2] https://github.com/openstack/cinder/blob/master/cinder/common/sqlalchemyutils.py#L115-L116\n\n[3] https://review.openstack.org/#/c/141914/7/cinder/db/sqlalchemy/api.py\n\n[4] https://github.com/openstack/cinder/blob/master/cinder/exception.py#L181-L182\n\nDid you find another case that I need to cover?\n\nThe UT in the dependent change set covers the invalid sort direction cases but I missed the coverage for an invalid sort key, I will add that.","commit_id":"f5edd74b515e6018372a913e174a4761faa32b58"}],"cinder/db/sqlalchemy/api.py":[{"author":{"_account_id":5538,"name":"Rushi Agrawal","email":"rushi.openstack@gmail.com","username":"rushiagr"},"change_message_id":"dd027092eba1256d47d22622ff2ac9da49d82aa8","unresolved":false,"context_lines":[{"line_number":1185,"context_line":"    \"\"\"Retrieves all volumes."},{"line_number":1186,"context_line":""},{"line_number":1187,"context_line":"    If no sort parameters are specified then the returned volumes are sorted"},{"line_number":1188,"context_line":"    by the \u0027created_at\u0027 and \u0027id\u0027 keys in descending order."},{"line_number":1189,"context_line":""},{"line_number":1190,"context_line":""},{"line_number":1191,"context_line":"    :param context: context to query under"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_a1903297","line":1188,"updated":"2015-02-17 04:57:13.000000000","message":"Some further clarification can be made, like so\n\n by first \u0027created_at\u0027 field and then \u0027id\u0027 field, in descending order.\n\nI think \u0027fields\u0027 make more sense here than \u0027keys\u0027","commit_id":"72afb8c0b092863519572f6ad6bc17f9579bc486"},{"author":{"_account_id":10559,"name":"Steven Kaufer","email":"kaufer@us.ibm.com","username":"kaufer"},"change_message_id":"d14f9ba18568645990aed635b8443f62dae8a74b","unresolved":false,"context_lines":[{"line_number":1185,"context_line":"    \"\"\"Retrieves all volumes."},{"line_number":1186,"context_line":""},{"line_number":1187,"context_line":"    If no sort parameters are specified then the returned volumes are sorted"},{"line_number":1188,"context_line":"    by the \u0027created_at\u0027 and \u0027id\u0027 keys in descending order."},{"line_number":1189,"context_line":""},{"line_number":1190,"context_line":""},{"line_number":1191,"context_line":"    :param context: context to query under"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_812ec0a3","line":1188,"in_reply_to":"da86d52c_a1903297","updated":"2015-02-17 14:25:09.000000000","message":"Rushi: Since the parameter name is \u0027sort_key\u0027 I\u0027d prefer to the doc to reference keys instead of fields. I will make the other change so that the text contains:\n\n    are sorted first by the \u0027created_at\u0027 key and then by the \u0027id\u0027 key in descending order.","commit_id":"72afb8c0b092863519572f6ad6bc17f9579bc486"}],"cinder/tests/api/v1/test_volumes.py":[{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"97f93dd493e7562db6b1d314802424a963348de0","unresolved":false,"context_lines":[{"line_number":645,"context_line":"            self.assertEqual(len(volumes), 1)"},{"line_number":646,"context_line":"            self.assertEqual(volumes[0][\u0027id\u0027], 2)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"        # admin case"},{"line_number":649,"context_line":"        volume_detail_limit_offset(is_admin\u003dTrue)"},{"line_number":650,"context_line":"        # non_admin case"},{"line_number":651,"context_line":"        volume_detail_limit_offset(is_admin\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_a011a753","line":648,"updated":"2015-02-25 18:58:47.000000000","message":"Are these necessary?","commit_id":"a176378361744aecaa8287ed4ca7e7c5fb6ba03f"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"fe6c3f9a3ae67cded1dc7cbc348e447201535d13","unresolved":false,"context_lines":[{"line_number":645,"context_line":"            self.assertEqual(len(volumes), 1)"},{"line_number":646,"context_line":"            self.assertEqual(volumes[0][\u0027id\u0027], 2)"},{"line_number":647,"context_line":""},{"line_number":648,"context_line":"        # admin case"},{"line_number":649,"context_line":"        volume_detail_limit_offset(is_admin\u003dTrue)"},{"line_number":650,"context_line":"        # non_admin case"},{"line_number":651,"context_line":"        volume_detail_limit_offset(is_admin\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_40262b69","line":648,"in_reply_to":"ba7be1f8_a011a753","updated":"2015-02-25 19:05:11.000000000","message":"nevermind.","commit_id":"a176378361744aecaa8287ed4ca7e7c5fb6ba03f"}],"cinder/volume/manager.py":[{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"97f93dd493e7562db6b1d314802424a963348de0","unresolved":false,"context_lines":[{"line_number":571,"context_line":"                # If volume is not created from image, No glance metadata"},{"line_number":572,"context_line":"                # would be available for that volume in"},{"line_number":573,"context_line":"                # volume glance metadata table"},{"line_number":574,"context_line":"                pass"},{"line_number":575,"context_line":"            except exception.CinderException as ex:"},{"line_number":576,"context_line":"                LOG.exception(_LE(\"Failed updating %(snapshot_id)s\""},{"line_number":577,"context_line":"                                  \" metadata using the provided volumes\""}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_a0db677a","line":574,"updated":"2015-02-25 18:58:47.000000000","message":"Is this supposed to be here?","commit_id":"a176378361744aecaa8287ed4ca7e7c5fb6ba03f"}]}
