)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"992228e0620023796b78e87a23bd1e372333bcd2","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add atomic conditional updates to objects"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"To allow atomic state changes all across Cinder services we need to"},{"line_number":10,"context_line":"implement a way to easily do compare-and-swap."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"This patch adds methods to allow compare-and-swap on DB models and on"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa1b9901_c2ff0433","line":9,"updated":"2015-08-17 18:15:48.000000000","message":"Suggest: \"..across Cinder services, we need to...\"","commit_id":"8ad04cce9396f96999b5b64b9f53ba0d71633883"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"aa574104fd52f9ce0703c54cd4a629d959b35ada","unresolved":false,"context_lines":[{"line_number":47,"context_line":"It can also be specified whether to save already dirtied fields from the"},{"line_number":48,"context_line":"objects or not and by default (if no expected_values argument is"},{"line_number":49,"context_line":"provided) it will make sure that the entry in the DB has the same values"},{"line_number":50,"context_line":"as the objected we are saving."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"We can select values based on conditions using Case objects in the"},{"line_number":53,"context_line":"\u0027values\u0027 argument. For example:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"ba15a1d1_06a93f7b","line":50,"updated":"2015-09-22 15:32:35.000000000","message":"s/objected/object if I understand correctly.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a1304e72b8dbf7578794f998dd178ba5448fdb54","unresolved":false,"context_lines":[{"line_number":47,"context_line":"It can also be specified whether to save already dirtied fields from the"},{"line_number":48,"context_line":"objects or not and by default (if no expected_values argument is"},{"line_number":49,"context_line":"provided) it will make sure that the entry in the DB has the same values"},{"line_number":50,"context_line":"as the objected we are saving."},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"We can select values based on conditions using Case objects in the"},{"line_number":53,"context_line":"\u0027values\u0027 argument. For example:"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"9a1a9d01_a536a5e5","line":50,"in_reply_to":"ba15a1d1_06a93f7b","updated":"2015-10-01 16:28:02.000000000","message":"Done","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"22ec98505be89ee89e0f44e93a7797ef7248c531","unresolved":false,"context_lines":[{"line_number":57,"context_line":" case_values \u003d volume.Case([(has_snapshot_filter, \u0027has-snapshot\u0027)],"},{"line_number":58,"context_line":"                           else_\u003d\u0027no-snapshot\u0027)"},{"line_number":59,"context_line":" volume.conditional_update({\u0027status\u0027: case_values},"},{"line_number":60,"context_line":"                           {\u0027status\u0027: \u0027available\u0027}))"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"Exclusion and multi-exclusion will handle, by default, NULL values like"},{"line_number":63,"context_line":"Python does instead of like SQL does, so NULL values will be considered"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7a2fa921_6006be87","line":60,"updated":"2015-10-08 04:17:42.000000000","message":"Looks like there is one more \u0027)\u0027.","commit_id":"b9baf4128120ea8f8a6bbf53da44ff319c19fe0c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e2610423d4ea0a43aaceaca2370737eca8566826","unresolved":false,"context_lines":[{"line_number":57,"context_line":" case_values \u003d volume.Case([(has_snapshot_filter, \u0027has-snapshot\u0027)],"},{"line_number":58,"context_line":"                           else_\u003d\u0027no-snapshot\u0027)"},{"line_number":59,"context_line":" volume.conditional_update({\u0027status\u0027: case_values},"},{"line_number":60,"context_line":"                           {\u0027status\u0027: \u0027available\u0027}))"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"Exclusion and multi-exclusion will handle, by default, NULL values like"},{"line_number":63,"context_line":"Python does instead of like SQL does, so NULL values will be considered"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":16,"id":"7a2fa921_92da494b","line":60,"in_reply_to":"7a2fa921_6006be87","updated":"2015-10-08 09:11:30.000000000","message":"Good eye!!","commit_id":"b9baf4128120ea8f8a6bbf53da44ff319c19fe0c"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"c79bb0bebfe66858c44f43c191f59c6d4904c934","unresolved":false,"context_lines":[{"line_number":57,"context_line":" case_values \u003d volume.Case([(has_snapshot_filter, \u0027has-snapshot\u0027)],"},{"line_number":58,"context_line":"                           else_\u003d\u0027no-snapshot\u0027)"},{"line_number":59,"context_line":" volume.conditional_update({\u0027status\u0027: case_values},"},{"line_number":60,"context_line":"                           {\u0027status\u0027: \u0027available\u0027}))"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"Exclusion and multi-exclusion will handle, by default, NULL values like"},{"line_number":63,"context_line":"Python does instead of like SQL does, so NULL values will be considered"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"5a2ca52d_f0043416","line":60,"updated":"2015-10-14 06:54:40.000000000","message":"Gorka, here still one more \u0027)\u0027, if you will update this patch, please remove it. :)","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"714a56d1562905ee878b585861f5c7440ff4ed9c","unresolved":false,"context_lines":[{"line_number":57,"context_line":" case_values \u003d volume.Case([(has_snapshot_filter, \u0027has-snapshot\u0027)],"},{"line_number":58,"context_line":"                           else_\u003d\u0027no-snapshot\u0027)"},{"line_number":59,"context_line":" volume.conditional_update({\u0027status\u0027: case_values},"},{"line_number":60,"context_line":"                           {\u0027status\u0027: \u0027available\u0027}))"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"Exclusion and multi-exclusion will handle, by default, NULL values like"},{"line_number":63,"context_line":"Python does instead of like SQL does, so NULL values will be considered"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"5a2ca52d_b0eeb789","line":60,"in_reply_to":"5a2ca52d_f0043416","updated":"2015-10-14 09:30:20.000000000","message":"I have changed in my local branch, will be changed on next push.","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7386c460aaa826f2e433a53e633208e5209190e7","unresolved":false,"context_lines":[{"line_number":70,"context_line":"because it will result in both previous_status and status being set to"},{"line_number":71,"context_line":"\u0027retyping\u0027.  Issue has been reported [1] and a patch to fix it [2] has"},{"line_number":72,"context_line":"been submitted."},{"line_number":73,"context_line":"[1]: https://bitbucket.org/zzzeek/sqlalchemy/issues/3541"},{"line_number":74,"context_line":"[2]: https://github.com/zzzeek/sqlalchemy/pull/200"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"Specs: https://review.openstack.org/232599/"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"fa80f949_46cc5d89","line":73,"updated":"2015-11-04 13:33:18.000000000","message":"Issue seems to be resolved, but you commit fixing it (fc73036) seems to live only on origin/pr200 branch, which isn\u0027t merged anywhere?","commit_id":"f2ad9cf4ad478df2791a891081cc55f986f54575"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"855c3c4eb398d41eb10da7d388b34120757cbdf0","unresolved":false,"context_lines":[{"line_number":70,"context_line":"because it will result in both previous_status and status being set to"},{"line_number":71,"context_line":"\u0027retyping\u0027.  Issue has been reported [1] and a patch to fix it [2] has"},{"line_number":72,"context_line":"been submitted."},{"line_number":73,"context_line":"[1]: https://bitbucket.org/zzzeek/sqlalchemy/issues/3541"},{"line_number":74,"context_line":"[2]: https://github.com/zzzeek/sqlalchemy/pull/200"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"Specs: https://review.openstack.org/232599/"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"ba8a016a_103ae798","line":73,"in_reply_to":"fa80f949_46cc5d89","updated":"2015-11-23 15:53:22.000000000","message":"That seems to be pre-release branch, so it should be added on next release.","commit_id":"f2ad9cf4ad478df2791a891081cc55f986f54575"}],"cinder/db/api.py":[{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"22ec98505be89ee89e0f44e93a7797ef7248c531","unresolved":false,"context_lines":[{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"       WARNING: SQLAlchemy does not allow selecting order of SET clauses, so"},{"line_number":1178,"context_line":"       for now we cannot do things like"},{"line_number":1179,"context_line":"           {\u0027previous_status\u0027: model.status, \u0027status\u0027: \u0027retyping\u0027}"},{"line_number":1180,"context_line":"       because it will result in both previous_status and status being set to"},{"line_number":1181,"context_line":"       \u0027retyping\u0027.  Issue has been reported [1] and a patch to fix it [2] has"},{"line_number":1182,"context_line":"       been submitted."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a2fa921_40d4e2bb","line":1179,"updated":"2015-10-08 04:17:42.000000000","message":"model.status -\u003e model.Volume.status if I understand correctly.\n\nAnd I have a concern: if we use this {\u0027status\u0027: \u0027deleting\u0027,\u0027previous_status\u0027: models.Volume.status} in line 1174, will it work correctly?","commit_id":"b9baf4128120ea8f8a6bbf53da44ff319c19fe0c"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"b1d8338ab65a904627473f9027de348eab2c0e69","unresolved":false,"context_lines":[{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"       WARNING: SQLAlchemy does not allow selecting order of SET clauses, so"},{"line_number":1178,"context_line":"       for now we cannot do things like"},{"line_number":1179,"context_line":"           {\u0027previous_status\u0027: model.status, \u0027status\u0027: \u0027retyping\u0027}"},{"line_number":1180,"context_line":"       because it will result in both previous_status and status being set to"},{"line_number":1181,"context_line":"       \u0027retyping\u0027.  Issue has been reported [1] and a patch to fix it [2] has"},{"line_number":1182,"context_line":"       been submitted."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a2fa921_1d988977","line":1179,"in_reply_to":"7a2fa921_12f8797a","updated":"2015-10-08 10:32:43.000000000","message":"Got it, thanks clarification.","commit_id":"b9baf4128120ea8f8a6bbf53da44ff319c19fe0c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"e2610423d4ea0a43aaceaca2370737eca8566826","unresolved":false,"context_lines":[{"line_number":1176,"context_line":""},{"line_number":1177,"context_line":"       WARNING: SQLAlchemy does not allow selecting order of SET clauses, so"},{"line_number":1178,"context_line":"       for now we cannot do things like"},{"line_number":1179,"context_line":"           {\u0027previous_status\u0027: model.status, \u0027status\u0027: \u0027retyping\u0027}"},{"line_number":1180,"context_line":"       because it will result in both previous_status and status being set to"},{"line_number":1181,"context_line":"       \u0027retyping\u0027.  Issue has been reported [1] and a patch to fix it [2] has"},{"line_number":1182,"context_line":"       been submitted."}],"source_content_type":"text/x-python","patch_set":16,"id":"7a2fa921_12f8797a","line":1179,"in_reply_to":"7a2fa921_40d4e2bb","updated":"2015-10-08 09:11:30.000000000","message":"No, it\u0027s model.status since I\u0027m referring to the specific model, not the models library (model \u003d models.Volume).\n\nThat line from 1174 will only work with DBs that reorder the SQL query, like SQLite does. But it will not work on DBs like MariaDB that are order dependent.  That\u0027s why I placed this warning.","commit_id":"b9baf4128120ea8f8a6bbf53da44ff319c19fe0c"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"2f0fb0088c03734825c9db2835690f4a7117c220","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"                              \u0027previous_status\u0027: models.Volume.status},"},{"line_number":1176,"context_line":"                             {\u0027status\u0027: (\u0027available\u0027, \u0027error\u0027)})"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"       WARNING: SQLAlchemy does not allow selecting order of SET clauses, so"},{"line_number":1179,"context_line":"       for now we cannot do things like"},{"line_number":1180,"context_line":"           {\u0027previous_status\u0027: model.status, \u0027status\u0027: \u0027retyping\u0027}"},{"line_number":1181,"context_line":"       because it will result in both previous_status and status being set to"}],"source_content_type":"text/x-python","patch_set":18,"id":"5a2ca52d_beb3180a","line":1178,"updated":"2015-10-13 12:08:50.000000000","message":"Maybe you should have that as TODO comment for easy listing?","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f031fa28621878489b576b47255da47e855ce1fb","unresolved":false,"context_lines":[{"line_number":1175,"context_line":"                              \u0027previous_status\u0027: models.Volume.status},"},{"line_number":1176,"context_line":"                             {\u0027status\u0027: (\u0027available\u0027, \u0027error\u0027)})"},{"line_number":1177,"context_line":""},{"line_number":1178,"context_line":"       WARNING: SQLAlchemy does not allow selecting order of SET clauses, so"},{"line_number":1179,"context_line":"       for now we cannot do things like"},{"line_number":1180,"context_line":"           {\u0027previous_status\u0027: model.status, \u0027status\u0027: \u0027retyping\u0027}"},{"line_number":1181,"context_line":"       because it will result in both previous_status and status being set to"}],"source_content_type":"text/x-python","patch_set":18,"id":"5a2ca52d_7472817e","line":1178,"in_reply_to":"5a2ca52d_beb3180a","updated":"2015-10-13 12:40:22.000000000","message":"It\u0027s not really a todo, since it\u0027s already done in another patch ;-) https://review.openstack.org/#/c/231936/\n\nAlthough I just realized I forgot to remove this WARNING in that patch.","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"}],"cinder/db/sqlalchemy/api.py":[{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"10bf12728abdc1289aebb1613a6633caec6f0063","unresolved":false,"context_lines":[{"line_number":3805,"context_line":"            # If it\u0027s a list/tuple of elements we use NOT IN"},{"line_number":3806,"context_line":"            if (isinstance(value, collections.Iterable) and"},{"line_number":3807,"context_line":"                    not isinstance(value, six.string_types)):"},{"line_number":3808,"context_line":"                where_conds.append(~getattr(model, field).in_(value))"},{"line_number":3809,"context_line":""},{"line_number":3810,"context_line":"            # For non iterables we just use !\u003d"},{"line_number":3811,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_5b0b032c","line":3808,"updated":"2015-08-07 17:53:44.000000000","message":"The `~` is bitwise invert in python. Since you have defined `NOT` in api.py, why don\u0027t use that?","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"492dbddfe9dd545be1a16828377eb6b6bac28a3d","unresolved":false,"context_lines":[{"line_number":3805,"context_line":"            # If it\u0027s a list/tuple of elements we use NOT IN"},{"line_number":3806,"context_line":"            if (isinstance(value, collections.Iterable) and"},{"line_number":3807,"context_line":"                    not isinstance(value, six.string_types)):"},{"line_number":3808,"context_line":"                where_conds.append(~getattr(model, field).in_(value))"},{"line_number":3809,"context_line":""},{"line_number":3810,"context_line":"            # For non iterables we just use !\u003d"},{"line_number":3811,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_e0a8a479","line":3808,"in_reply_to":"1a4dcd0f_1cd788c0","updated":"2015-08-25 09:55:41.000000000","message":"Got it. Thanks for your explanation!","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a3885ea2522715603f6d0a07f4ec94515ffeaba1","unresolved":false,"context_lines":[{"line_number":3805,"context_line":"            # If it\u0027s a list/tuple of elements we use NOT IN"},{"line_number":3806,"context_line":"            if (isinstance(value, collections.Iterable) and"},{"line_number":3807,"context_line":"                    not isinstance(value, six.string_types)):"},{"line_number":3808,"context_line":"                where_conds.append(~getattr(model, field).in_(value))"},{"line_number":3809,"context_line":""},{"line_number":3810,"context_line":"            # For non iterables we just use !\u003d"},{"line_number":3811,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_1cd788c0","line":3808,"in_reply_to":"1a4dcd0f_5b0b032c","updated":"2015-08-14 11:42:04.000000000","message":"These are 2 different things, the Not is something we use to know when they want to use !\u003d or NOT IN, and the ~ is an operation of sqlalchemy which turns in_ operation into not in_ operation.","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"10bf12728abdc1289aebb1613a6633caec6f0063","unresolved":false,"context_lines":[{"line_number":3824,"context_line":"        query \u003d model_query(context, model, read_deleted\u003d\u0027no\u0027,"},{"line_number":3825,"context_line":"                            project_only\u003dTrue)"},{"line_number":3826,"context_line":"        # Return True if we were able to change any DB entry, False otherwise"},{"line_number":3827,"context_line":"        result \u003d query.filter(*where_conds).update(values,"},{"line_number":3828,"context_line":"                                                   synchronize_session\u003dFalse)"},{"line_number":3829,"context_line":"        return 0 !\u003d result"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_1eb8092a","line":3827,"updated":"2015-08-07 17:53:44.000000000","message":"Where is the atomicity of the compare and set (filter and update)? Is it ensured by the session.begin() transaction?","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a3885ea2522715603f6d0a07f4ec94515ffeaba1","unresolved":false,"context_lines":[{"line_number":3824,"context_line":"        query \u003d model_query(context, model, read_deleted\u003d\u0027no\u0027,"},{"line_number":3825,"context_line":"                            project_only\u003dTrue)"},{"line_number":3826,"context_line":"        # Return True if we were able to change any DB entry, False otherwise"},{"line_number":3827,"context_line":"        result \u003d query.filter(*where_conds).update(values,"},{"line_number":3828,"context_line":"                                                   synchronize_session\u003dFalse)"},{"line_number":3829,"context_line":"        return 0 !\u003d result"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_bc569428","line":3827,"in_reply_to":"1a4dcd0f_1eb8092a","updated":"2015-08-14 11:42:04.000000000","message":"Atomicity is accomplished because the update is conditioned to the where_conds using the filter, so it will turn into something like:\n\n UPDATE VOLUMES SET STATUS\u003d\u0027deleting\u0027 WHERE ID\u003d\u0027xxxx...xxx\u0027 and STATUS\u003d\u0027available\u0027;\n\nSo the status would only be updated if the conditions are met, in this case that the status stays the same and in the DB this locks the row automatically.\n\nThis is more efficient than using select for update, and will still work in multi-master galera clusters, but we can still get deadlocks when multiple requests try to change this at the same time and the conditions are met in them all, and that\u0027s why we have the _retry_on_deadlock decorator.","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"492dbddfe9dd545be1a16828377eb6b6bac28a3d","unresolved":false,"context_lines":[{"line_number":3824,"context_line":"        query \u003d model_query(context, model, read_deleted\u003d\u0027no\u0027,"},{"line_number":3825,"context_line":"                            project_only\u003dTrue)"},{"line_number":3826,"context_line":"        # Return True if we were able to change any DB entry, False otherwise"},{"line_number":3827,"context_line":"        result \u003d query.filter(*where_conds).update(values,"},{"line_number":3828,"context_line":"                                                   synchronize_session\u003dFalse)"},{"line_number":3829,"context_line":"        return 0 !\u003d result"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa1b9901_c0f1e0ce","line":3827,"in_reply_to":"1a4dcd0f_bc569428","updated":"2015-08-25 09:55:41.000000000","message":"Thanks for your explanation! Good point.","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"346f0106ca2ecc5d19bd4d68ef425b39a480dee6","unresolved":false,"context_lines":[{"line_number":3867,"context_line":"    If value is an iterable other than a string any of the values are"},{"line_number":3868,"context_line":"    acceptable (OR), so we\u0027ll use SQL IN operator."},{"line_number":3869,"context_line":""},{"line_number":3870,"context_line":"    If it\u0027s not an interator \u003d\u003d operator will be used."},{"line_number":3871,"context_line":"    \"\"\""},{"line_number":3872,"context_line":"    # For values that must match and are iterables we use IN"},{"line_number":3873,"context_line":"    if (isinstance(value, collections.Iterable) and"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_ed37584b","line":3870,"updated":"2015-08-24 21:22:35.000000000","message":"interator -\u003e iterator","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12634c691b19309a4a3d24ecaedf8d48da74e30a","unresolved":false,"context_lines":[{"line_number":3867,"context_line":"    If value is an iterable other than a string any of the values are"},{"line_number":3868,"context_line":"    acceptable (OR), so we\u0027ll use SQL IN operator."},{"line_number":3869,"context_line":""},{"line_number":3870,"context_line":"    If it\u0027s not an interator \u003d\u003d operator will be used."},{"line_number":3871,"context_line":"    \"\"\""},{"line_number":3872,"context_line":"    # For values that must match and are iterables we use IN"},{"line_number":3873,"context_line":"    if (isinstance(value, collections.Iterable) and"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_26ca346f","line":3870,"in_reply_to":"fa1b9901_ed37584b","updated":"2015-08-25 10:37:54.000000000","message":"Done","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"346f0106ca2ecc5d19bd4d68ef425b39a480dee6","unresolved":false,"context_lines":[{"line_number":3873,"context_line":"    if (isinstance(value, collections.Iterable) and"},{"line_number":3874,"context_line":"            not isinstance(value, six.string_types)):"},{"line_number":3875,"context_line":"        return getattr(model, field).in_(value)"},{"line_number":3876,"context_line":"    # For values that must match and are not iterables we use \u003d\u003d\u003d"},{"line_number":3877,"context_line":"    return getattr(model, field) \u003d\u003d value"},{"line_number":3878,"context_line":""},{"line_number":3879,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_2df1d06a","line":3876,"updated":"2015-08-24 21:22:35.000000000","message":"\u0027\u003d\u003d\u003d\u0027 change to \u0027\u003d\u003d\u0027","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12634c691b19309a4a3d24ecaedf8d48da74e30a","unresolved":false,"context_lines":[{"line_number":3873,"context_line":"    if (isinstance(value, collections.Iterable) and"},{"line_number":3874,"context_line":"            not isinstance(value, six.string_types)):"},{"line_number":3875,"context_line":"        return getattr(model, field).in_(value)"},{"line_number":3876,"context_line":"    # For values that must match and are not iterables we use \u003d\u003d\u003d"},{"line_number":3877,"context_line":"    return getattr(model, field) \u003d\u003d value"},{"line_number":3878,"context_line":""},{"line_number":3879,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_c6c81877","line":3876,"in_reply_to":"fa1b9901_2df1d06a","updated":"2015-08-25 10:37:54.000000000","message":"Done","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"aa574104fd52f9ce0703c54cd4a629d959b35ada","unresolved":false,"context_lines":[{"line_number":4141,"context_line":"def condition_db_filter(model, field, value):"},{"line_number":4142,"context_line":"    \"\"\"Create matching filter."},{"line_number":4143,"context_line":""},{"line_number":4144,"context_line":"    If value is an iterable other than a string any of the values are"},{"line_number":4145,"context_line":"    acceptable as a match (OR), so we\u0027ll use SQL IN operator."},{"line_number":4146,"context_line":""},{"line_number":4147,"context_line":"    If it\u0027s not an iterator \u003d\u003d operator will be used."}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_96dd8044","line":4144,"updated":"2015-09-22 15:32:35.000000000","message":"I guess this should be rephrased to something along these lines:\n\n    If value is an iterable other than a string and all the values are\n    acceptable as a match, SQL IN operator will be used.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a1304e72b8dbf7578794f998dd178ba5448fdb54","unresolved":false,"context_lines":[{"line_number":4141,"context_line":"def condition_db_filter(model, field, value):"},{"line_number":4142,"context_line":"    \"\"\"Create matching filter."},{"line_number":4143,"context_line":""},{"line_number":4144,"context_line":"    If value is an iterable other than a string any of the values are"},{"line_number":4145,"context_line":"    acceptable as a match (OR), so we\u0027ll use SQL IN operator."},{"line_number":4146,"context_line":""},{"line_number":4147,"context_line":"    If it\u0027s not an iterator \u003d\u003d operator will be used."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_f4477175","line":4144,"in_reply_to":"ba15a1d1_96dd8044","updated":"2015-10-01 16:28:02.000000000","message":"Actually, the only missing thing was a comma an changing are to is : \"other than a string, any of the values is acceptable\".  Thanks for catching this confusing sentence.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"aa574104fd52f9ce0703c54cd4a629d959b35ada","unresolved":false,"context_lines":[{"line_number":4163,"context_line":"def condition_not_db_filter(model, field, value, auto_none\u003dTrue):"},{"line_number":4164,"context_line":"    \"\"\"Create non matching filter."},{"line_number":4165,"context_line":""},{"line_number":4166,"context_line":"    If value is an iterable other than a string any of the values are"},{"line_number":4167,"context_line":"    acceptable as a match (OR), so we\u0027ll use SQL NOT IN operator."},{"line_number":4168,"context_line":""},{"line_number":4169,"context_line":"    If it\u0027s not an iterator \u003d\u003d operator will be used."}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_76e30c06","line":4166,"updated":"2015-09-22 15:32:35.000000000","message":"ditto","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a1304e72b8dbf7578794f998dd178ba5448fdb54","unresolved":false,"context_lines":[{"line_number":4163,"context_line":"def condition_not_db_filter(model, field, value, auto_none\u003dTrue):"},{"line_number":4164,"context_line":"    \"\"\"Create non matching filter."},{"line_number":4165,"context_line":""},{"line_number":4166,"context_line":"    If value is an iterable other than a string any of the values are"},{"line_number":4167,"context_line":"    acceptable as a match (OR), so we\u0027ll use SQL NOT IN operator."},{"line_number":4168,"context_line":""},{"line_number":4169,"context_line":"    If it\u0027s not an iterator \u003d\u003d operator will be used."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_8f406037","line":4166,"in_reply_to":"ba15a1d1_76e30c06","updated":"2015-10-01 16:28:02.000000000","message":"Same as above.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a1304e72b8dbf7578794f998dd178ba5448fdb54","unresolved":false,"context_lines":[{"line_number":4163,"context_line":"def condition_not_db_filter(model, field, value, auto_none\u003dTrue):"},{"line_number":4164,"context_line":"    \"\"\"Create non matching filter."},{"line_number":4165,"context_line":""},{"line_number":4166,"context_line":"    If value is an iterable other than a string any of the values are"},{"line_number":4167,"context_line":"    acceptable as a match (OR), so we\u0027ll use SQL NOT IN operator."},{"line_number":4168,"context_line":""},{"line_number":4169,"context_line":"    If it\u0027s not an iterator \u003d\u003d operator will be used."}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_af3d24bd","line":4166,"in_reply_to":"ba15a1d1_76e30c06","updated":"2015-10-01 16:28:02.000000000","message":"Same as above.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"2f0fb0088c03734825c9db2835690f4a7117c220","unresolved":false,"context_lines":[{"line_number":4158,"context_line":"def condition_db_filter(model, field, value):"},{"line_number":4159,"context_line":"    \"\"\"Create matching filter."},{"line_number":4160,"context_line":""},{"line_number":4161,"context_line":"    If value is an iterable other than a string, any of the values is"},{"line_number":4162,"context_line":"    a valid match (OR), so we\u0027ll use SQL IN operator."},{"line_number":4163,"context_line":""},{"line_number":4164,"context_line":"    If it\u0027s not an iterator \u003d\u003d operator will be used."}],"source_content_type":"text/x-python","patch_set":18,"id":"5a2ca52d_7ea3409f","line":4161,"updated":"2015-10-13 12:08:50.000000000","message":"Now it\u0027s clear, single comma can have a difference. :)","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"a5641f80ae279f26d025182439173103561ca8f7","unresolved":false,"context_lines":[{"line_number":4232,"context_line":""},{"line_number":4233,"context_line":"    # Return True if we were able to change any DB entry, False otherwise"},{"line_number":4234,"context_line":"    result \u003d query.filter(*where_conds).update(values,"},{"line_number":4235,"context_line":"                                               synchronize_session\u003dFalse)"},{"line_number":4236,"context_line":"    return 0 !\u003d result"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a2fa921_fa4f6f68","line":4235,"updated":"2015-10-10 08:33:21.000000000","message":"Gorka, is the following words atomic operation in db? \n\nquery.filter(*where_conds).update(values,                                                synchronize_session\u003dFalse)\n\nMy understanding is that it gets query result at first, and then update the db entries.\n\nSo two steps here: client sends queries to db host, and gets results back. And then sends update request to db host again, and gets updated.","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"81612b5cd3cb83208667aa70eec7c466ff4d0492","unresolved":false,"context_lines":[{"line_number":4232,"context_line":""},{"line_number":4233,"context_line":"    # Return True if we were able to change any DB entry, False otherwise"},{"line_number":4234,"context_line":"    result \u003d query.filter(*where_conds).update(values,"},{"line_number":4235,"context_line":"                                               synchronize_session\u003dFalse)"},{"line_number":4236,"context_line":"    return 0 !\u003d result"}],"source_content_type":"text/x-python","patch_set":18,"id":"5a2ca52d_6a3ffb25","line":4235,"in_reply_to":"7a2fa921_bfb31be9","updated":"2015-10-13 11:49:01.000000000","message":"You are correct, it constructs an \"update ... where ...\" SQL clause.","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"c9a2071e6334bed6df4102abbf2bc03571c26a9d","unresolved":false,"context_lines":[{"line_number":4232,"context_line":""},{"line_number":4233,"context_line":"    # Return True if we were able to change any DB entry, False otherwise"},{"line_number":4234,"context_line":"    result \u003d query.filter(*where_conds).update(values,"},{"line_number":4235,"context_line":"                                               synchronize_session\u003dFalse)"},{"line_number":4236,"context_line":"    return 0 !\u003d result"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a2fa921_bfb31be9","line":4235,"in_reply_to":"7a2fa921_fa4f6f68","updated":"2015-10-12 01:29:40.000000000","message":"Please ignore above comments. It looks like the sql words \"update ...where...\"","commit_id":"9aa4ef481c6704637f75b001ba924b1f115d62c8"}],"cinder/objects/base.py":[{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"992228e0620023796b78e87a23bd1e372333bcd2","unresolved":false,"context_lines":[{"line_number":79,"context_line":"           Update will only happen in the DB and the object if conditions are"},{"line_number":80,"context_line":"           met."},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"           If no expected_values are passed we will default to make sure that"},{"line_number":83,"context_line":"           all fields have not been changed in the DB. Since we cannot know"},{"line_number":84,"context_line":"           the original value in the DB for dirty fields in the object those"},{"line_number":85,"context_line":"           will be excluded."}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_e26d68cd","line":82,"updated":"2015-08-17 18:15:48.000000000","message":"Suggest: \"...are passed in, the default will ensure that...\"","commit_id":"8ad04cce9396f96999b5b64b9f53ba0d71633883"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"992228e0620023796b78e87a23bd1e372333bcd2","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                    and 1 if we could, because we are using unique index id."},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        if not hasattr(self, \u0027ORM_MODEL\u0027) or \u0027id\u0027 not in self.fields:"},{"line_number":109,"context_line":"            msg \u003d (_(\u0027VersionedObject %s does not support conditional update\u0027)"},{"line_number":110,"context_line":"                   % (self.__name__))"},{"line_number":111,"context_line":"            raise NotImplementedError(msg)"},{"line_number":112,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa1b9901_4e17a5a3","line":109,"updated":"2015-08-17 18:15:48.000000000","message":"\".\" at EOL","commit_id":"8ad04cce9396f96999b5b64b9f53ba0d71633883"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"bcea9debffa86150d80c124b9974b02fa154dc80","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                # If we don\u0027t have a get_by_id from_db_object method we can\u0027t"},{"line_number":160,"context_line":"                # read from the DB so we don\u0027t try to update our object"},{"line_number":161,"context_line":"                if not hasattr(self, \u0027get_by_id\u0027):"},{"line_number":162,"context_line":"                    msg \u003d (u\u0027No get_by_id in %s, some field will not be \u0027"},{"line_number":163,"context_line":"                           \u0027updated.\u0027 % (self.__name__))"},{"line_number":164,"context_line":"                    LOG.debug(msg)"},{"line_number":165,"context_line":"                    values \u003d {field: value for field, value in values.items()"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_869b00c9","line":162,"updated":"2015-08-25 10:27:26.000000000","message":"I think you don\u0027t need to add an `u`.","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"f4cf63c85aa88208346a61fb10c2e62347e93977","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                # If we don\u0027t have a get_by_id from_db_object method we can\u0027t"},{"line_number":160,"context_line":"                # read from the DB so we don\u0027t try to update our object"},{"line_number":161,"context_line":"                if not hasattr(self, \u0027get_by_id\u0027):"},{"line_number":162,"context_line":"                    msg \u003d (u\u0027No get_by_id in %s, some field will not be \u0027"},{"line_number":163,"context_line":"                           \u0027updated.\u0027 % (self.__name__))"},{"line_number":164,"context_line":"                    LOG.debug(msg)"},{"line_number":165,"context_line":"                    values \u003d {field: value for field, value in values.items()"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_8c08feda","line":162,"in_reply_to":"fa1b9901_499c185d","updated":"2015-08-25 12:24:21.000000000","message":"Thanks, that\u0027s a very good point!!","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"7541b2c43a2ddb0ec62b782fabcf0f144adf451b","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                # If we don\u0027t have a get_by_id from_db_object method we can\u0027t"},{"line_number":160,"context_line":"                # read from the DB so we don\u0027t try to update our object"},{"line_number":161,"context_line":"                if not hasattr(self, \u0027get_by_id\u0027):"},{"line_number":162,"context_line":"                    msg \u003d (u\u0027No get_by_id in %s, some field will not be \u0027"},{"line_number":163,"context_line":"                           \u0027updated.\u0027 % (self.__name__))"},{"line_number":164,"context_line":"                    LOG.debug(msg)"},{"line_number":165,"context_line":"                    values \u003d {field: value for field, value in values.items()"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_499c185d","line":162,"in_reply_to":"fa1b9901_862c604b","updated":"2015-08-25 12:17:58.000000000","message":"Got your point. Thanks! But would six.text_type helps because it is Python 2 \u0026 3 compatible? Found concerns such as\n\n    https://bugs.launchpad.net/hacking/+bug/1257091","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12634c691b19309a4a3d24ecaedf8d48da74e30a","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                # If we don\u0027t have a get_by_id from_db_object method we can\u0027t"},{"line_number":160,"context_line":"                # read from the DB so we don\u0027t try to update our object"},{"line_number":161,"context_line":"                if not hasattr(self, \u0027get_by_id\u0027):"},{"line_number":162,"context_line":"                    msg \u003d (u\u0027No get_by_id in %s, some field will not be \u0027"},{"line_number":163,"context_line":"                           \u0027updated.\u0027 % (self.__name__))"},{"line_number":164,"context_line":"                    LOG.debug(msg)"},{"line_number":165,"context_line":"                    values \u003d {field: value for field, value in values.items()"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_862c604b","line":162,"in_reply_to":"fa1b9901_869b00c9","updated":"2015-08-25 10:37:54.000000000","message":"I prefer to protect the code against a unicode __name__ value.","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"aa574104fd52f9ce0703c54cd4a629d959b35ada","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            kargs \u003d {\u0027expected_attrs\u0027: getattr(cls, \u0027DEFAULT_EXPECTED_ATTR\u0027)}"},{"line_number":98,"context_line":"        return cls._from_db_object(context, cls(context), orm_obj, **kargs)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def conditional_update(self, values, expected_values\u003dNone, filters\u003d(),"},{"line_number":101,"context_line":"                           save_all\u003dFalse, session\u003dNone, reflect_changes\u003dTrue):"},{"line_number":102,"context_line":"        \"\"\"Compare-and-swap update."},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_a33725af","line":100,"updated":"2015-09-22 15:32:35.000000000","message":"No strong feelings on that, but Nova implemented conditional update on objects in standard save method. I wonder if that wouldn\u0027t be applicable for Cinder also.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a1304e72b8dbf7578794f998dd178ba5448fdb54","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            kargs \u003d {\u0027expected_attrs\u0027: getattr(cls, \u0027DEFAULT_EXPECTED_ATTR\u0027)}"},{"line_number":98,"context_line":"        return cls._from_db_object(context, cls(context), orm_obj, **kargs)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def conditional_update(self, values, expected_values\u003dNone, filters\u003d(),"},{"line_number":101,"context_line":"                           save_all\u003dFalse, session\u003dNone, reflect_changes\u003dTrue):"},{"line_number":102,"context_line":"        \"\"\"Compare-and-swap update."},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_0f0450c4","line":100,"in_reply_to":"ba15a1d1_a33725af","updated":"2015-10-01 16:28:02.000000000","message":"We have different save methods for each object, so that would probably be a lot more complicated to do.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e6ca775e4b4296c245955abbed6c9f7093a1010c","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            values \u003d changes"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        result \u003d db.conditional_update(self._context, self.model, values,"},{"line_number":184,"context_line":"                                       expected, filters, session)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        # If we were able to update the DB then we need to update this object"},{"line_number":187,"context_line":"        # as well to reflect new DB contents and clear the object\u0027s dirty flags"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_19a2dc99","line":184,"updated":"2015-09-23 10:31:05.000000000","message":"conditional_update doesn\u0027t actually have session parameter I think. You\u0027re passing it as include_deleted if I understand correctly.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a1304e72b8dbf7578794f998dd178ba5448fdb54","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            values \u003d changes"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        result \u003d db.conditional_update(self._context, self.model, values,"},{"line_number":184,"context_line":"                                       expected, filters, session)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        # If we were able to update the DB then we need to update this object"},{"line_number":187,"context_line":"        # as well to reflect new DB contents and clear the object\u0027s dirty flags"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_aff524cc","line":184,"in_reply_to":"ba15a1d1_19a2dc99","updated":"2015-10-01 16:28:02.000000000","message":"Good catch!!  That\u0027s a leftover from a previous patch.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"691094086fd5c983c7d989c79adc83b599b434ab","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            values \u003d changes"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"        result \u003d db.conditional_update(self._context, self.model, values,"},{"line_number":184,"context_line":"                                       expected, filters, session)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        # If we were able to update the DB then we need to update this object"},{"line_number":187,"context_line":"        # as well to reflect new DB contents and clear the object\u0027s dirty flags"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a1a9d01_a6c2b332","line":184,"in_reply_to":"ba15a1d1_19a2dc99","updated":"2015-09-29 03:50:27.000000000","message":"correct.  there is no session param defined in the db.conditional_update","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"7386c460aaa826f2e433a53e633208e5209190e7","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        # If we were able to update the DB then we need to update this object"},{"line_number":187,"context_line":"        # as well to reflect new DB contents and clear the object\u0027s dirty flags"},{"line_number":188,"context_line":"        # for those fields."},{"line_number":189,"context_line":"        if result and reflect_changes:"},{"line_number":190,"context_line":"            # If we have used a Case, a db field or an expression in values we"},{"line_number":191,"context_line":"            # don\u0027t know which value was used, so we need to read the object"},{"line_number":192,"context_line":"            # back from the DB"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa80f949_a604297e","line":189,"updated":"2015-11-04 13:33:18.000000000","message":"Just a thought - if we weren\u0027t successful maybe it\u0027s a good idea to load the object from the DB to reflect changes that made update unsuccessful?","commit_id":"f2ad9cf4ad478df2791a891081cc55f986f54575"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"855c3c4eb398d41eb10da7d388b34120757cbdf0","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        # If we were able to update the DB then we need to update this object"},{"line_number":187,"context_line":"        # as well to reflect new DB contents and clear the object\u0027s dirty flags"},{"line_number":188,"context_line":"        # for those fields."},{"line_number":189,"context_line":"        if result and reflect_changes:"},{"line_number":190,"context_line":"            # If we have used a Case, a db field or an expression in values we"},{"line_number":191,"context_line":"            # don\u0027t know which value was used, so we need to read the object"},{"line_number":192,"context_line":"            # back from the DB"}],"source_content_type":"text/x-python","patch_set":19,"id":"ba8a016a_70e7b312","line":189,"in_reply_to":"fa80f949_a604297e","updated":"2015-11-23 15:53:22.000000000","message":"I\u0027d rather not, because then you may be losing the data you currently have.  It should be up to the caller to decide what is the right thing to do when update failed.","commit_id":"f2ad9cf4ad478df2791a891081cc55f986f54575"}],"cinder/objects/snapshot.py":[{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"857689e3c3f51418b46cff9d4365056c532e9db8","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class Snapshot(base.CinderPersistentObject, base.CinderObject,"},{"line_number":32,"context_line":"               base.CinderObjectDictCompat):"},{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    # NOTE(thangp): OPTIONAL_FIELDS are fields that would be lazy-loaded. They"},{"line_number":37,"context_line":"    # are typically the relationship in the sqlalchemy object."}],"source_content_type":"text/x-python","patch_set":20,"id":"ba8a016a_f9c960ad","line":34,"updated":"2015-11-23 12:08:45.000000000","message":"Should we update this version to \u00271.1\u0027?","commit_id":"8afd8a4ab20dfa62ef6b0fe7605939abc8fb6549"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"e4f3f3260fd4d55853c439a24143e95d12b4dd5d","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class Snapshot(base.CinderPersistentObject, base.CinderObject,"},{"line_number":32,"context_line":"               base.CinderObjectDictCompat):"},{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    # NOTE(thangp): OPTIONAL_FIELDS are fields that would be lazy-loaded. They"},{"line_number":37,"context_line":"    # are typically the relationship in the sqlalchemy object."}],"source_content_type":"text/x-python","patch_set":20,"id":"9a8ffd7b_30bd62b7","line":34,"in_reply_to":"ba8a016a_352fdda2","updated":"2015-11-27 01:04:21.000000000","message":"OK,Got it.","commit_id":"8afd8a4ab20dfa62ef6b0fe7605939abc8fb6549"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bb920fac9ce48db1b96a88f96a3dc4cf6161687b","unresolved":false,"context_lines":[{"line_number":31,"context_line":"class Snapshot(base.CinderPersistentObject, base.CinderObject,"},{"line_number":32,"context_line":"               base.CinderObjectDictCompat):"},{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    # NOTE(thangp): OPTIONAL_FIELDS are fields that would be lazy-loaded. They"},{"line_number":37,"context_line":"    # are typically the relationship in the sqlalchemy object."}],"source_content_type":"text/x-python","patch_set":20,"id":"ba8a016a_352fdda2","line":34,"in_reply_to":"ba8a016a_f9c960ad","updated":"2015-11-23 15:53:45.000000000","message":"I thought about it before submitting the patch and concluded that we don\u0027t, though I could be wrong.  There are no changes on fields or behavior.","commit_id":"8afd8a4ab20dfa62ef6b0fe7605939abc8fb6549"}],"cinder/objects/volume.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"c2aaa488d9ac2a8e1a7c5b7461bd9f6dfef32ab2","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            db.volume_destroy(self._context, self.id)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def obj_load_attr(self, attrname):"},{"line_number":222,"context_line":"        if attrname not in self.OPTIONAL_FIELDS:"},{"line_number":223,"context_line":"            raise exception.ObjectActionError("},{"line_number":224,"context_line":"                action\u003d\u0027obj_load_attr\u0027,"},{"line_number":225,"context_line":"                reason\u003d_(\u0027attribute %s not lazy-loadable\u0027) % attrname)"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_7972714b","line":222,"updated":"2015-09-20 17:51:54.000000000","message":"OPTIONAL_FIELDS is a class variable and not an instance variable, so it\u0027s probably more syntactically correct to use Volume.OPTIONAL_FIELDS instead of self.OPTIONAL_FIELDS.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7cc2c5fe3f9befdda32f703b8542b449317efa8d","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            db.volume_destroy(self._context, self.id)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def obj_load_attr(self, attrname):"},{"line_number":222,"context_line":"        if attrname not in self.OPTIONAL_FIELDS:"},{"line_number":223,"context_line":"            raise exception.ObjectActionError("},{"line_number":224,"context_line":"                action\u003d\u0027obj_load_attr\u0027,"},{"line_number":225,"context_line":"                reason\u003d_(\u0027attribute %s not lazy-loadable\u0027) % attrname)"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_9d93a34f","line":222,"in_reply_to":"ba15a1d1_7972714b","updated":"2015-09-21 11:25:54.000000000","message":"When I have access to the instance I try to access all attributes and methods, even class ones, through it instead of the class, in case later on I need to do weird stuff like dynamically changing only one instance\u0027s behavior by overwriting the class attribute/method at instance level.\n\nBut if you have a strong feeling about this I\u0027ll change it.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"24a1300396028f3188bad3ca2f174309d77e6426","unresolved":false,"context_lines":[{"line_number":219,"context_line":"            db.volume_destroy(self._context, self.id)"},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"    def obj_load_attr(self, attrname):"},{"line_number":222,"context_line":"        if attrname not in self.OPTIONAL_FIELDS:"},{"line_number":223,"context_line":"            raise exception.ObjectActionError("},{"line_number":224,"context_line":"                action\u003d\u0027obj_load_attr\u0027,"},{"line_number":225,"context_line":"                reason\u003d_(\u0027attribute %s not lazy-loadable\u0027) % attrname)"}],"source_content_type":"text/x-python","patch_set":15,"id":"ba15a1d1_093f5526","line":222,"in_reply_to":"ba15a1d1_9d93a34f","updated":"2015-09-21 13:16:20.000000000","message":"No, no strong feeling. I think that makes sense. I know some static code analyzers would flag something like this, but I\u0027m sure they don\u0027t take into account attribute/method overwriting.","commit_id":"be7b13397d96d8f5a3d8411592fda2ea876cfe52"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"857689e3c3f51418b46cff9d4365056c532e9db8","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    # Version 1.1: Added metadata, admin_metadata, volume_attachment, and"},{"line_number":35,"context_line":"    #              volume_type"},{"line_number":36,"context_line":"    VERSION \u003d \u00271.1\u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    OPTIONAL_FIELDS \u003d (\u0027metadata\u0027, \u0027admin_metadata\u0027,"},{"line_number":39,"context_line":"                       \u0027volume_type\u0027, \u0027volume_attachment\u0027)"}],"source_content_type":"text/x-python","patch_set":20,"id":"ba8a016a_3937e8b1","line":36,"updated":"2015-11-23 12:08:45.000000000","message":"Should we update this version to \u00271.2\u0027?","commit_id":"8afd8a4ab20dfa62ef6b0fe7605939abc8fb6549"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bb920fac9ce48db1b96a88f96a3dc4cf6161687b","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    # Version 1.1: Added metadata, admin_metadata, volume_attachment, and"},{"line_number":35,"context_line":"    #              volume_type"},{"line_number":36,"context_line":"    VERSION \u003d \u00271.1\u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    OPTIONAL_FIELDS \u003d (\u0027metadata\u0027, \u0027admin_metadata\u0027,"},{"line_number":39,"context_line":"                       \u0027volume_type\u0027, \u0027volume_attachment\u0027)"}],"source_content_type":"text/x-python","patch_set":20,"id":"ba8a016a_f0fe4304","line":36,"in_reply_to":"ba8a016a_3937e8b1","updated":"2015-11-23 15:53:45.000000000","message":"I thought about it before submitting the patch and concluded that we don\u0027t, though I could be wrong.  There are no changes on fields or behavior.","commit_id":"8afd8a4ab20dfa62ef6b0fe7605939abc8fb6549"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"e4f3f3260fd4d55853c439a24143e95d12b4dd5d","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    # Version 1.1: Added metadata, admin_metadata, volume_attachment, and"},{"line_number":35,"context_line":"    #              volume_type"},{"line_number":36,"context_line":"    VERSION \u003d \u00271.1\u0027"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"    OPTIONAL_FIELDS \u003d (\u0027metadata\u0027, \u0027admin_metadata\u0027,"},{"line_number":39,"context_line":"                       \u0027volume_type\u0027, \u0027volume_attachment\u0027)"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a8ffd7b_90cc4e6b","line":36,"in_reply_to":"ba8a016a_f0fe4304","updated":"2015-11-27 01:04:21.000000000","message":"Got it.","commit_id":"8afd8a4ab20dfa62ef6b0fe7605939abc8fb6549"}],"cinder/tests/unit/objects/test_base.py":[{"author":{"_account_id":10674,"name":"Yusuke Hayashi","email":"yusuke.hayashi.710@gmail.com","username":"YusukeHayashi"},"change_message_id":"77c0423b864f6b55f4265e499c74f57b9c7b8e06","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from iso8601 import iso8601"},{"line_number":19,"context_line":"from sqlalchemy import sql"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from cinder.objects import base"},{"line_number":22,"context_line":"from cinder import context"},{"line_number":23,"context_line":"from cinder import db"},{"line_number":24,"context_line":"from cinder.db.sqlalchemy import models"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_d36b6ff0","line":21,"updated":"2015-08-08 00:07:47.000000000","message":"pep8 reports H306  imports not in alphabetical order.\n\n\"from cinder.objects import base\" should be moved next line of\n\"from cinder import objects\".","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a3885ea2522715603f6d0a07f4ec94515ffeaba1","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from iso8601 import iso8601"},{"line_number":19,"context_line":"from sqlalchemy import sql"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from cinder.objects import base"},{"line_number":22,"context_line":"from cinder import context"},{"line_number":23,"context_line":"from cinder import db"},{"line_number":24,"context_line":"from cinder.db.sqlalchemy import models"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a4dcd0f_bc7534fb","line":21,"in_reply_to":"1a4dcd0f_d36b6ff0","updated":"2015-08-14 11:42:04.000000000","message":"Thanks!!  Since this was a PoC I wrote everything in a hurry, will change it in next patch.","commit_id":"07d212d135efe7264940c0b10ec31fcec5443267"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"346f0106ca2ecc5d19bd4d68ef425b39a480dee6","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            {\u0027status\u0027: \u0027deleting\u0027}, save_all\u003dTrue))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        # Check that the object in memory has not been updated and that the"},{"line_number":170,"context_line":"        # but size is still a dirty key"},{"line_number":171,"context_line":"        self._check_volume(volume, \u0027available\u0027, volume.size, False, [\u0027size\u0027])"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # Check that the volume in the DB hasn\u0027t been updated"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_3092874c","line":170,"updated":"2015-08-24 21:22:35.000000000","message":"\u0027but\u0027 -\u003e \u0027\u0027","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12634c691b19309a4a3d24ecaedf8d48da74e30a","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            {\u0027status\u0027: \u0027deleting\u0027}, save_all\u003dTrue))"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        # Check that the object in memory has not been updated and that the"},{"line_number":170,"context_line":"        # but size is still a dirty key"},{"line_number":171,"context_line":"        self._check_volume(volume, \u0027available\u0027, volume.size, False, [\u0027size\u0027])"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        # Check that the volume in the DB hasn\u0027t been updated"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_66ea6cae","line":170,"in_reply_to":"fa1b9901_3092874c","updated":"2015-08-25 10:37:54.000000000","message":"Done","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":7173,"name":"Scott DAngelo","email":"scott.dangelo@gmail.com","username":"scottda"},"change_message_id":"346f0106ca2ecc5d19bd4d68ef425b39a480dee6","unresolved":false,"context_lines":[{"line_number":405,"context_line":"        self._check_volume(volume, \u0027no-snapshot\u0027, 1, True)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"    def test_conditional_update_non_iterable_case_value_fail(self):"},{"line_number":408,"context_line":"        # Volume we want to change and has snapshots"},{"line_number":409,"context_line":"        volume \u003d self._create_volume()"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        # Filter that checks if a volume has snapshots"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_3034c7f9","line":408,"updated":"2015-08-24 21:22:35.000000000","message":"This volume does not have snapshots","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12634c691b19309a4a3d24ecaedf8d48da74e30a","unresolved":false,"context_lines":[{"line_number":405,"context_line":"        self._check_volume(volume, \u0027no-snapshot\u0027, 1, True)"},{"line_number":406,"context_line":""},{"line_number":407,"context_line":"    def test_conditional_update_non_iterable_case_value_fail(self):"},{"line_number":408,"context_line":"        # Volume we want to change and has snapshots"},{"line_number":409,"context_line":"        volume \u003d self._create_volume()"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        # Filter that checks if a volume has snapshots"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_4635e843","line":408,"in_reply_to":"fa1b9901_3034c7f9","updated":"2015-08-25 10:37:54.000000000","message":"Done","commit_id":"16eb6eeeef5c9a3e49e4239e8c62c0fa2960ea6c"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"5bc5c754bb1617e4c846d985122a596190ac491a","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            \u0027host\u0027: \u0027dummy\u0027,"},{"line_number":98,"context_line":"            \u0027attach_status\u0027: \u0027no\u0027,"},{"line_number":99,"context_line":"        }"},{"line_number":100,"context_line":"        volume \u003d objects.volume.Volume(context\u003dself.context, **vol)"},{"line_number":101,"context_line":"        volume.create()"},{"line_number":102,"context_line":"        return volume"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_b069cec0","line":100,"updated":"2015-08-27 17:32:13.000000000","message":"It is not necessary to specify the full path. You just need objects.Volume.get_by_id. The objects module, when loaded, will import the known objects.  There are several places where you did this below.","commit_id":"8344649cc73399a8ae6d552ee93198136cb8ff55"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"b78e5bb305763dcb530db7bfdfa18837746740ed","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            \u0027host\u0027: \u0027dummy\u0027,"},{"line_number":98,"context_line":"            \u0027attach_status\u0027: \u0027no\u0027,"},{"line_number":99,"context_line":"        }"},{"line_number":100,"context_line":"        volume \u003d objects.volume.Volume(context\u003dself.context, **vol)"},{"line_number":101,"context_line":"        volume.create()"},{"line_number":102,"context_line":"        return volume"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"da20952f_b49bf971","line":100,"in_reply_to":"da20952f_b069cec0","updated":"2015-08-27 20:39:18.000000000","message":"Jaja, you are right, I only change them to full names when I\u0027m debugging, because ./run_tests.sh when specifying a specific test doesn\u0027t play nicely with Versioned Objects.  ;-)\n\nWill change in next patch.","commit_id":"8344649cc73399a8ae6d552ee93198136cb8ff55"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"b8bb77f8f29e1070b696263ede1f886cecaf2bba","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        return volume"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def _create_snapshot(self, volume):"},{"line_number":105,"context_line":"        snapshot \u003d objects.snapshot.Snapshot(context\u003dself.context,"},{"line_number":106,"context_line":"                                             volume_id\u003dvolume.id)"},{"line_number":107,"context_line":"        snapshot.create()"},{"line_number":108,"context_line":"        return snapshot"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_6eb5802f","line":105,"updated":"2015-08-28 02:21:40.000000000","message":"Ditto","commit_id":"46a9b5237d1563e664685613f409250f61704b80"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12265a1b91bd98dd9d1f412993e0b1dbb47ae5fe","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        return volume"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def _create_snapshot(self, volume):"},{"line_number":105,"context_line":"        snapshot \u003d objects.snapshot.Snapshot(context\u003dself.context,"},{"line_number":106,"context_line":"                                             volume_id\u003dvolume.id)"},{"line_number":107,"context_line":"        snapshot.create()"},{"line_number":108,"context_line":"        return snapshot"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_f7087c93","line":105,"in_reply_to":"da20952f_6eb5802f","updated":"2015-08-28 08:57:02.000000000","message":"Done","commit_id":"46a9b5237d1563e664685613f409250f61704b80"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"b8bb77f8f29e1070b696263ede1f886cecaf2bba","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        return snapshot"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _check_volume(self, volume, status, size, reload\u003dFalse, dirty_keys\u003d()):"},{"line_number":111,"context_line":"        if reload:"},{"line_number":112,"context_line":"            volume \u003d objects.volume.Volume.get_by_id(self.context, volume.id)"},{"line_number":113,"context_line":"        self.assertEqual(status, volume.status)"},{"line_number":114,"context_line":"        self.assertEqual(size, volume.size)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_8eb01445","line":111,"updated":"2015-08-28 02:21:40.000000000","message":"You missed these other ones here.  s/objects.volume/objects/","commit_id":"46a9b5237d1563e664685613f409250f61704b80"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12265a1b91bd98dd9d1f412993e0b1dbb47ae5fe","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        return snapshot"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"    def _check_volume(self, volume, status, size, reload\u003dFalse, dirty_keys\u003d()):"},{"line_number":111,"context_line":"        if reload:"},{"line_number":112,"context_line":"            volume \u003d objects.volume.Volume.get_by_id(self.context, volume.id)"},{"line_number":113,"context_line":"        self.assertEqual(status, volume.status)"},{"line_number":114,"context_line":"        self.assertEqual(size, volume.size)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_97ffc066","line":111,"in_reply_to":"da20952f_8eb01445","updated":"2015-08-28 08:57:02.000000000","message":"Done","commit_id":"46a9b5237d1563e664685613f409250f61704b80"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"b8bb77f8f29e1070b696263ede1f886cecaf2bba","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self._check_volume(volume, \u0027deleting\u0027, volume.size, True)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test_default_conditional_fail_update_non_iterable_expected(self):"},{"line_number":187,"context_line":"        volume_in_db \u003d self._create_volume()"},{"line_number":188,"context_line":"        volume \u003d objects.volume.Volume.get_by_id(self.context, volume_in_db.id)"},{"line_number":189,"context_line":"        volume_in_db.size +\u003d 1"},{"line_number":190,"context_line":"        volume_in_db.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_aeab98d5","line":187,"updated":"2015-08-28 02:21:40.000000000","message":"Ditto","commit_id":"46a9b5237d1563e664685613f409250f61704b80"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12265a1b91bd98dd9d1f412993e0b1dbb47ae5fe","unresolved":false,"context_lines":[{"line_number":184,"context_line":"        self._check_volume(volume, \u0027deleting\u0027, volume.size, True)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test_default_conditional_fail_update_non_iterable_expected(self):"},{"line_number":187,"context_line":"        volume_in_db \u003d self._create_volume()"},{"line_number":188,"context_line":"        volume \u003d objects.volume.Volume.get_by_id(self.context, volume_in_db.id)"},{"line_number":189,"context_line":"        volume_in_db.size +\u003d 1"},{"line_number":190,"context_line":"        volume_in_db.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_b702046e","line":187,"in_reply_to":"da20952f_aeab98d5","updated":"2015-08-28 08:57:02.000000000","message":"Done","commit_id":"46a9b5237d1563e664685613f409250f61704b80"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"b8bb77f8f29e1070b696263ede1f886cecaf2bba","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        self._check_volume(volume_in_db, \u0027available\u0027, volume_in_db.size, True)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def test_default_conditional_update_non_iterable_expected_with_dirty(self):"},{"line_number":202,"context_line":"        volume_in_db \u003d self._create_volume()"},{"line_number":203,"context_line":"        volume \u003d objects.volume.Volume.get_by_id(self.context, volume_in_db.id)"},{"line_number":204,"context_line":"        volume_in_db.size +\u003d 1"},{"line_number":205,"context_line":"        volume_in_db.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_4ebafc24","line":202,"updated":"2015-08-28 02:21:40.000000000","message":"Ditto","commit_id":"46a9b5237d1563e664685613f409250f61704b80"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"12265a1b91bd98dd9d1f412993e0b1dbb47ae5fe","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        self._check_volume(volume_in_db, \u0027available\u0027, volume_in_db.size, True)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def test_default_conditional_update_non_iterable_expected_with_dirty(self):"},{"line_number":202,"context_line":"        volume_in_db \u003d self._create_volume()"},{"line_number":203,"context_line":"        volume \u003d objects.volume.Volume.get_by_id(self.context, volume_in_db.id)"},{"line_number":204,"context_line":"        volume_in_db.size +\u003d 1"},{"line_number":205,"context_line":"        volume_in_db.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"da20952f_57fa8876","line":202,"in_reply_to":"da20952f_4ebafc24","updated":"2015-08-28 08:57:02.000000000","message":"Done","commit_id":"46a9b5237d1563e664685613f409250f61704b80"}]}
