)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"48ae854aeb6fd7066a27e0f8d77b0d52634622e7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add precommit event for security group"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add PRECOMMIT_CREATE/DELETE/UPDATE event type for callback function, and"},{"line_number":10,"context_line":"use it in the security group db transaction."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":13,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a740942_6b55cb1b","line":10,"updated":"2015-12-03 20:50:28.000000000","message":"Can you please explain the motivation behind this patch in the commit log.\ni.e. why in addition to what.","commit_id":"f5f25735925e2bebf50b4e1cba91e96f17a1f4e4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"d0f3148cb0db520bb36453b680e802e484cfffc6","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add precommit event for security group"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add PRECOMMIT_CREATE/DELETE/UPDATE event type for callback function, and"},{"line_number":10,"context_line":"use it in the security group db transaction."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":13,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7a740942_41822002","line":10,"in_reply_to":"7a740942_6b55cb1b","updated":"2015-12-04 04:18:59.000000000","message":"Done","commit_id":"f5f25735925e2bebf50b4e1cba91e96f17a1f4e4"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"bb5f97aaeb4a90daf949110d95e6472b99f07687","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add precommit_XXX event for security group and rules"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Current BEFORE_CREATE/DELETE/UPDATE event is outside of the DB"},{"line_number":10,"context_line":"transaction. Unlike the precommit premitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"unsync issue if we use BEFORE_XXX event."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a740942_395ddaec","line":10,"updated":"2015-12-09 19:18:44.000000000","message":"nit: premitive -\u003e primative","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5ed738ecaff58b5d4c7f8d515dfba17caad9c0a5","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add precommit_XXX event for security group and rules"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Current BEFORE_CREATE/DELETE/UPDATE event is outside of the DB"},{"line_number":10,"context_line":"transaction. Unlike the precommit premitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"unsync issue if we use BEFORE_XXX event."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a740942_5495d63d","line":10,"in_reply_to":"7a740942_395ddaec","updated":"2015-12-10 16:21:12.000000000","message":"thanks, it\u0027s primitive.","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"bb5f97aaeb4a90daf949110d95e6472b99f07687","unresolved":false,"context_lines":[{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"unsync issue if we use BEFORE_XXX event."},{"line_number":14,"context_line":"This patch adds PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"},{"line_number":15,"context_line":"function, and use it in the securitygroup/rules db transaction."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a740942_5c8c5435","line":14,"updated":"2015-12-09 19:18:44.000000000","message":"Can the existing callbacks be moved into the transactions (and thus not need the new events)?","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"317913d6eb9fd0144811c31470149c3bcacfb044","unresolved":false,"context_lines":[{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"unsync issue if we use BEFORE_XXX event."},{"line_number":14,"context_line":"This patch adds PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"},{"line_number":15,"context_line":"function, and use it in the securitygroup/rules db transaction."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a740942_ef9207f6","line":14,"in_reply_to":"7a740942_5c8c5435","updated":"2015-12-10 07:45:07.000000000","message":"No. It was discussed at https://review.openstack.org/#/c/240356/","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5ed738ecaff58b5d4c7f8d515dfba17caad9c0a5","unresolved":false,"context_lines":[{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"unsync issue if we use BEFORE_XXX event."},{"line_number":14,"context_line":"This patch adds PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"},{"line_number":15,"context_line":"function, and use it in the securitygroup/rules db transaction."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a740942_d4030675","line":14,"in_reply_to":"7a740942_ef9207f6","updated":"2015-12-10 16:21:12.000000000","message":"+1","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"cb3809b9847a0aac598c4e3774d1d993e7ee9e35","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add precommit_XXX event for security group and rules"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Current BEFORE_CREATE/DELETE/UPDATE event is outside of the DB"},{"line_number":10,"context_line":"transaction. Unlike the precommit primitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"unsync issue if we use BEFORE_XXX event."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7a740942_4440aea5","line":10,"updated":"2015-12-10 21:51:42.000000000","message":"Not sure if you want to mention that they are outside, because they may do RPC (and that the ones inside the transaction must not).","commit_id":"3385c0ae7c74de868bb0aecf4c8dc4e60a27890e"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"c7c981fb75671b74ae2904d0b91575f045a9b919","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add precommit_XXX event for security group and rules"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Current BEFORE_CREATE/DELETE/UPDATE event is outside of the DB"},{"line_number":10,"context_line":"transaction. Unlike the precommit primitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"unsync issue if we use BEFORE_XXX event."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"7a740942_0289fe25","line":10,"in_reply_to":"7a740942_4440aea5","updated":"2015-12-11 20:26:43.000000000","message":"ok, I will add it.","commit_id":"3385c0ae7c74de868bb0aecf4c8dc4e60a27890e"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"42cf346671e3a1e8c2c91184c845a4a02b065f9d","unresolved":false,"context_lines":[{"line_number":10,"context_line":"transaction. Unlike the precommit primitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"more unsync issue if we use BEFORE_XXX event. That move the BEFORE_XXX event"},{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a740942_1439f8f1","line":13,"updated":"2015-12-14 16:00:27.000000000","message":"That move the -\u003e Moving the","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":17211,"name":"Brandon Palm","email":"bapalm@us.ibm.com","username":"bapalm"},"change_message_id":"9968901c81cdc564bf4412542350690c4e69f948","unresolved":false,"context_lines":[{"line_number":10,"context_line":"transaction. Unlike the precommit primitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"more unsync issue if we use BEFORE_XXX event. That move the BEFORE_XXX event"},{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a740942_24915f47","line":13,"updated":"2015-12-14 16:36:49.000000000","message":"issues*","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"9e1623294e2882bea4b6ccd53c2d59ec04bb9194","unresolved":false,"context_lines":[{"line_number":10,"context_line":"transaction. Unlike the precommit primitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"more unsync issue if we use BEFORE_XXX event. That move the BEFORE_XXX event"},{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5a710552_7e1d8fbc","line":13,"in_reply_to":"7a740942_1439f8f1","updated":"2015-12-14 23:45:14.000000000","message":"Done","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"9e1623294e2882bea4b6ccd53c2d59ec04bb9194","unresolved":false,"context_lines":[{"line_number":10,"context_line":"transaction. Unlike the precommit primitive in ML2 mech drivers, they"},{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"more unsync issue if we use BEFORE_XXX event. That move the BEFORE_XXX event"},{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5a710552_7e46efc0","line":13,"in_reply_to":"7a740942_24915f47","updated":"2015-12-14 23:45:14.000000000","message":"Done","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6d2ab18c5320d71d5cbef5577d88990cc65428cf","unresolved":false,"context_lines":[{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"more unsync issue if we use BEFORE_XXX event. That move the BEFORE_XXX event"},{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"},{"line_number":17,"context_line":"function, and use it in the securitygroup/rules DB transaction. We keep"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5a710552_cc2ae22c","line":14,"updated":"2015-12-14 20:24:48.000000000","message":"I think we should be prescriptive about the use of PRECOMMIT events. Since their only purpose is to do stuff in atomicity with other DB operations, their only purpose is to do DB operations, as nothing else can be rolled back.\n\nI missed this in past reviews.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"9e1623294e2882bea4b6ccd53c2d59ec04bb9194","unresolved":false,"context_lines":[{"line_number":11,"context_line":"don\u0027t work in the same DB transaction of resource, so if we want to"},{"line_number":12,"context_line":"operate the DB in mech driver related to security group, there would be"},{"line_number":13,"context_line":"more unsync issue if we use BEFORE_XXX event. That move the BEFORE_XXX event"},{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"},{"line_number":17,"context_line":"function, and use it in the securitygroup/rules DB transaction. We keep"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"5a710552_8a54ba54","line":14,"in_reply_to":"5a710552_cc2ae22c","updated":"2015-12-14 23:45:14.000000000","message":"Done","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"26a49d844110e2e4e4d47cc361f0189dabd6122f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"},{"line_number":17,"context_line":"function, and use it in the securitygroup/rules DB transaction. We keep"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":20,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a740942_90b3df4c","line":17,"range":{"start_line":17,"start_character":64,"end_line":17,"end_character":71},"updated":"2015-12-13 09:48:56.000000000","message":"we keep what?","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"07765ff09a1924478833456120a8aa633bdb6740","unresolved":false,"context_lines":[{"line_number":14,"context_line":"inside may also break some current codes, as maybe RPC call included."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for callback"},{"line_number":17,"context_line":"function, and use it in the securitygroup/rules DB transaction. We keep"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":20,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a740942_36e54008","line":17,"in_reply_to":"7a740942_90b3df4c","updated":"2015-12-14 15:31:21.000000000","message":"Done","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"de1c406f00d6f62392f976bf12887080e381341b","unresolved":false,"context_lines":[{"line_number":19,"context_line":"PRECOMMIT_XXX is in the DB transaction and only purpose is to do DB"},{"line_number":20,"context_line":"operations in its callback. This patch also update the notify_loop logic"},{"line_number":21,"context_line":"to trigger PrecommitCallbackFailure when exception comes from the"},{"line_number":22,"context_line":"callback of the new event."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":25,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"da6ed579_fb784dc6","line":22,"range":{"start_line":22,"start_character":20,"end_line":22,"end_character":25},"updated":"2016-01-13 16:50:05.000000000","message":"Not sure if this PrecommitCallbackFailure is that useful. Most likely you\u0027d have something like:\n\n  try:\n    with context.session.begin(subtransactions\u003dTrue):\n      registry.notify(\n          resources.SECURITY_GROUP, events.PRECOMMIT_DELETE, self,\n              **kwargs)\n           context.session.delete(sg)\n  except DBException:\n      # something went wrong when committing the transaction\n  except CallbackException:\n      # something went wrong when executing the callback\n      # (not due to DB errors, but a programatically raised Exception)\n\nWhy would you distinguish between the base and the derived Exception?\n\nI\u0027d vote to remove it and simplifying the changes to the notify loop, unless you can provide a compelling reason why to keep it.","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"d690f8175d3b1d0220946e4c2896c135b1287622","unresolved":false,"context_lines":[{"line_number":19,"context_line":"PRECOMMIT_XXX is in the DB transaction and only purpose is to do DB"},{"line_number":20,"context_line":"operations in its callback. This patch also update the notify_loop logic"},{"line_number":21,"context_line":"to trigger PrecommitCallbackFailure when exception comes from the"},{"line_number":22,"context_line":"callback of the new event."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":25,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"da6ed579_96d2245b","line":22,"range":{"start_line":22,"start_character":20,"end_line":22,"end_character":25},"in_reply_to":"da6ed579_0d4aa3ac","updated":"2016-01-14 07:42:35.000000000","message":"thanks armax, what I am confused is that the current code only raise CallbackFailure when BEFORE event, not for AFTER events or others. I thought CallbackFailure is intended designed like it, so it\u0027s not triggered by \"an error in *any* type of callback\". \n\nI will reuse the CallbackFailure, just not sure if it changes some previous logic here.","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9ad3ea1ccfd3a928a6463d830d37af2aa08c7d16","unresolved":false,"context_lines":[{"line_number":19,"context_line":"PRECOMMIT_XXX is in the DB transaction and only purpose is to do DB"},{"line_number":20,"context_line":"operations in its callback. This patch also update the notify_loop logic"},{"line_number":21,"context_line":"to trigger PrecommitCallbackFailure when exception comes from the"},{"line_number":22,"context_line":"callback of the new event."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":25,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"da6ed579_0d4aa3ac","line":22,"range":{"start_line":22,"start_character":20,"end_line":22,"end_character":25},"in_reply_to":"da6ed579_eac29533","updated":"2016-01-14 06:31:34.000000000","message":"the CallbackFailure is raised by the registry because of an exception caused by an error in *any* type of callback. DB exceptions induced by broken PRECOMMIT handlers are not gonna be caught by the registry\u0027s notify loop. If you see the snipped above, there\u0027s no way it makes sense to distinguish between CallbackFailure and PrecommitCallbackFailure, so please remove it.","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"3b020212677cdb6345a31e80ca51c6aff3489b87","unresolved":false,"context_lines":[{"line_number":19,"context_line":"PRECOMMIT_XXX is in the DB transaction and only purpose is to do DB"},{"line_number":20,"context_line":"operations in its callback. This patch also update the notify_loop logic"},{"line_number":21,"context_line":"to trigger PrecommitCallbackFailure when exception comes from the"},{"line_number":22,"context_line":"callback of the new event."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"},{"line_number":25,"context_line":"Closes-Bug: #1522172"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"da6ed579_eac29533","line":22,"range":{"start_line":22,"start_character":20,"end_line":22,"end_character":25},"in_reply_to":"da6ed579_fb784dc6","updated":"2016-01-14 05:48:20.000000000","message":"thanks armax, because the current CallbackFailure only be triggered by exception in callback of the BEFORE event.\nThe notify method will cover all the other exception, like from precommit/after event(https://review.openstack.org/#/c/252755/14/neutron/callbacks/manager.py), so \nI add the PrecommitCallbackFailure to distinguish it from BEFORE type.","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"166472a73d20be18838a1dd17cc72d99dcb380ec","unresolved":false,"context_lines":[{"line_number":17,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for"},{"line_number":18,"context_line":"callback function, and use it in the securitygroup/rules DB transaction."},{"line_number":19,"context_line":"PRECOMMIT_XXX is in the DB transaction and only purpose is to do DB"},{"line_number":20,"context_line":"operations in its callback. And CallbackFailure will be triggered when"},{"line_number":21,"context_line":"exception comes from the callback of the new event."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"7a5de9d1_836a7119","line":20,"range":{"start_line":20,"start_character":28,"end_line":20,"end_character":31},"updated":"2016-01-27 13:02:15.000000000","message":"Nit: And -\u003e A","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"ec85cfc594f9d1e8084c2213ea8211fc72d01622","unresolved":false,"context_lines":[{"line_number":17,"context_line":"This patch adds new PRECOMMIT_CREATE/DELETE/UPDATE event type for"},{"line_number":18,"context_line":"callback function, and use it in the securitygroup/rules DB transaction."},{"line_number":19,"context_line":"PRECOMMIT_XXX is in the DB transaction and only purpose is to do DB"},{"line_number":20,"context_line":"operations in its callback. And CallbackFailure will be triggered when"},{"line_number":21,"context_line":"exception comes from the callback of the new event."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: Icd2849bd84dab6733a572e8c85f242afcefc6c78"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"7a5de9d1_9bfcf83f","line":20,"range":{"start_line":20,"start_character":28,"end_line":20,"end_character":31},"in_reply_to":"7a5de9d1_836a7119","updated":"2016-01-28 02:43:01.000000000","message":"Done","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"}],"doc/source/devref/callbacks.rst":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77e0881e68a6ad714e150e716deb5cbd77a6fd0b","unresolved":false,"context_lines":[{"line_number":369,"context_line":"What kind of operation I can add into callback?"},{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or function that"},{"line_number":372,"context_line":"  would take a long time, like communicating to SDN controller over network. Because PRECOMMIT"},{"line_number":373,"context_line":"  events are meant to be introduced to allow for DB (and only for DB) operations to be done in the"},{"line_number":374,"context_line":"  same transaction context. Rollback is taken care of by the context manager."},{"line_number":375,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"3a7e1126_968629b8","line":372,"range":{"start_line":372,"start_character":85,"end_line":372,"end_character":94},"updated":"2015-12-17 01:12:00.000000000","message":"this phrase taken out of context doesn\u0027t mean much. What you mean to say that callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as such errors (should they occur) will be taken care by the context manager.","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"18ece592fc7e7b823e887fc02c63860c6bbf80c0","unresolved":false,"context_lines":[{"line_number":369,"context_line":"What kind of operation I can add into callback?"},{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or function that"},{"line_number":372,"context_line":"  would take a long time, like communicating to SDN controller over network. Because PRECOMMIT"},{"line_number":373,"context_line":"  events are meant to be introduced to allow for DB (and only for DB) operations to be done in the"},{"line_number":374,"context_line":"  same transaction context. Rollback is taken care of by the context manager."},{"line_number":375,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"3a7e1126_8db8d6c9","line":372,"range":{"start_line":372,"start_character":85,"end_line":372,"end_character":94},"in_reply_to":"3a7e1126_968629b8","updated":"2015-12-18 16:04:40.000000000","message":"thanks, Done","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"05e0cb5e8f742003c4146d3e78c43081aff4c91f","unresolved":false,"context_lines":[{"line_number":376,"context_line":"What kind of function can be a callback?"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"  Anything you fancy: lambdas, \u0027closures\u0027, class, object or module methods. "},{"line_number":379,"context_line":"  "},{"line_number":380,"context_line":"  For instance:"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"::"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5a710552_a8039972","line":379,"updated":"2015-12-15 13:22:55.000000000","message":"Unintended change to file?","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"18ece592fc7e7b823e887fc02c63860c6bbf80c0","unresolved":false,"context_lines":[{"line_number":376,"context_line":"What kind of function can be a callback?"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"  Anything you fancy: lambdas, \u0027closures\u0027, class, object or module methods. "},{"line_number":379,"context_line":"  "},{"line_number":380,"context_line":"  For instance:"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"::"}],"source_content_type":"text/x-rst","patch_set":9,"id":"5a710552_00d118fa","line":379,"in_reply_to":"5a710552_a8039972","updated":"2015-12-18 16:04:40.000000000","message":"Done","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d93f303f23e67253b8a882dbaa0b3b1af7a06392","unresolved":false,"context_lines":[{"line_number":368,"context_line":""},{"line_number":369,"context_line":"What kind of operation I can add into callback?"},{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."}],"source_content_type":"text/x-rst","patch_set":11,"id":"1a7b0d38_d531dea3","line":371,"range":{"start_line":371,"start_character":71,"end_line":371,"end_character":79},"updated":"2015-12-23 15:40:33.000000000","message":"function \u003d\u003e functions","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d93f303f23e67253b8a882dbaa0b3b1af7a06392","unresolved":false,"context_lines":[{"line_number":368,"context_line":""},{"line_number":369,"context_line":"What kind of operation I can add into callback?"},{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."}],"source_content_type":"text/x-rst","patch_set":11,"id":"1a7b0d38_3521424e","line":371,"range":{"start_line":371,"start_character":83,"end_line":371,"end_character":86},"updated":"2015-12-23 15:40:33.000000000","message":"the \u003d\u003e a","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"50b6c0747389582ac6887cbe71de19b7110ce9f7","unresolved":false,"context_lines":[{"line_number":368,"context_line":""},{"line_number":369,"context_line":"What kind of operation I can add into callback?"},{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."}],"source_content_type":"text/x-rst","patch_set":11,"id":"fa69d971_d81fef59","line":371,"range":{"start_line":371,"start_character":83,"end_line":371,"end_character":86},"in_reply_to":"1a7b0d38_3521424e","updated":"2015-12-30 08:04:47.000000000","message":"Done","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"50b6c0747389582ac6887cbe71de19b7110ce9f7","unresolved":false,"context_lines":[{"line_number":368,"context_line":""},{"line_number":369,"context_line":"What kind of operation I can add into callback?"},{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."}],"source_content_type":"text/x-rst","patch_set":11,"id":"fa69d971_1826e7ba","line":371,"range":{"start_line":371,"start_character":71,"end_line":371,"end_character":79},"in_reply_to":"1a7b0d38_d531dea3","updated":"2015-12-30 08:04:47.000000000","message":"Done","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d93f303f23e67253b8a882dbaa0b3b1af7a06392","unresolved":false,"context_lines":[{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"What kind of function can be a callback?"}],"source_content_type":"text/x-rst","patch_set":11,"id":"1a7b0d38_55e5ee06","line":373,"range":{"start_line":373,"start_character":2,"end_line":373,"end_character":10},"updated":"2015-12-23 15:40:33.000000000","message":"Callback \u003d\u003e Callbacks","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d93f303f23e67253b8a882dbaa0b3b1af7a06392","unresolved":false,"context_lines":[{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"What kind of function can be a callback?"}],"source_content_type":"text/x-rst","patch_set":11,"id":"1a7b0d38_15c68667","line":373,"range":{"start_line":373,"start_character":93,"end_line":373,"end_character":95},"updated":"2015-12-23 15:40:33.000000000","message":"as such \u003d\u003e such as\n\nin addition to this the sentence does not make sense at the end","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"50b6c0747389582ac6887cbe71de19b7110ce9f7","unresolved":false,"context_lines":[{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"What kind of function can be a callback?"}],"source_content_type":"text/x-rst","patch_set":11,"id":"fa69d971_983ad7cc","line":373,"range":{"start_line":373,"start_character":93,"end_line":373,"end_character":95},"in_reply_to":"1a7b0d38_15c68667","updated":"2015-12-30 08:04:47.000000000","message":"Done. I just want to clarify the error handle process of this event.","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"50b6c0747389582ac6887cbe71de19b7110ce9f7","unresolved":false,"context_lines":[{"line_number":370,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":371,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking function or the function"},{"line_number":372,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":373,"context_line":"  Callback for PRECOMMIT events are meant to execute DB operations in a transaction context, as"},{"line_number":374,"context_line":"  such errors (should they occur) will be taken care by the context manager."},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"What kind of function can be a callback?"}],"source_content_type":"text/x-rst","patch_set":11,"id":"fa69d971_f8a993e0","line":373,"range":{"start_line":373,"start_character":2,"end_line":373,"end_character":10},"in_reply_to":"1a7b0d38_55e5ee06","updated":"2015-12-30 08:04:47.000000000","message":"Done","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"36abb2ce04a8a8ece414dba1afda2ef24bc1c5a0","unresolved":false,"context_lines":[{"line_number":230,"context_line":"the same callback register to both BEFORE_* and the respective ABORT_* event; as a matter of"},{"line_number":231,"context_line":"fact, it is best to make use of different callbacks to keep the two logic separate."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can get from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other left callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate a ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"}],"source_content_type":"text/x-rst","patch_set":14,"id":"fa69d971_d36bac1c","line":233,"range":{"start_line":233,"start_character":37,"end_line":233,"end_character":46},"updated":"2016-01-11 16:34:42.000000000","message":"exception \u003d\u003e an exception","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"36abb2ce04a8a8ece414dba1afda2ef24bc1c5a0","unresolved":false,"context_lines":[{"line_number":230,"context_line":"the same callback register to both BEFORE_* and the respective ABORT_* event; as a matter of"},{"line_number":231,"context_line":"fact, it is best to make use of different callbacks to keep the two logic separate."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can get from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other left callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate a ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"}],"source_content_type":"text/x-rst","patch_set":14,"id":"fa69d971_537fbcdf","line":233,"range":{"start_line":233,"start_character":10,"end_line":233,"end_character":13},"updated":"2016-01-11 16:34:42.000000000","message":"nit get \u003d\u003e see","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"3b020212677cdb6345a31e80ca51c6aff3489b87","unresolved":false,"context_lines":[{"line_number":230,"context_line":"the same callback register to both BEFORE_* and the respective ABORT_* event; as a matter of"},{"line_number":231,"context_line":"fact, it is best to make use of different callbacks to keep the two logic separate."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can get from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other left callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate a ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"}],"source_content_type":"text/x-rst","patch_set":14,"id":"da6ed579_6ca806dc","line":233,"range":{"start_line":233,"start_character":37,"end_line":233,"end_character":46},"in_reply_to":"fa69d971_d36bac1c","updated":"2016-01-14 05:48:20.000000000","message":"Done","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"36abb2ce04a8a8ece414dba1afda2ef24bc1c5a0","unresolved":false,"context_lines":[{"line_number":231,"context_line":"fact, it is best to make use of different callbacks to keep the two logic separate."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can get from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other left callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate a ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"},{"line_number":237,"context_line":"PRECOMMIT_XXX, notify process will raise unified PrecommitCallbackFailure exception. For the"}],"source_content_type":"text/x-rst","patch_set":14,"id":"fa69d971_d3d96cf4","line":234,"range":{"start_line":234,"start_character":44,"end_line":234,"end_character":48},"updated":"2016-01-11 16:34:42.000000000","message":"left \u003d\u003e remaining or left \u003d\u003e abort","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"3b020212677cdb6345a31e80ca51c6aff3489b87","unresolved":false,"context_lines":[{"line_number":231,"context_line":"fact, it is best to make use of different callbacks to keep the two logic separate."},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can get from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other left callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate a ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"},{"line_number":237,"context_line":"PRECOMMIT_XXX, notify process will raise unified PrecommitCallbackFailure exception. For the"}],"source_content_type":"text/x-rst","patch_set":14,"id":"da6ed579_0cb2aa4c","line":234,"range":{"start_line":234,"start_character":44,"end_line":234,"end_character":48},"in_reply_to":"fa69d971_d3d96cf4","updated":"2016-01-14 05:48:20.000000000","message":"Done","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"36abb2ce04a8a8ece414dba1afda2ef24bc1c5a0","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can get from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other left callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate a ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"},{"line_number":237,"context_line":"PRECOMMIT_XXX, notify process will raise unified PrecommitCallbackFailure exception. For the"},{"line_number":238,"context_line":"exception triggered from other events, like AFTER_XXX, there will no exception raised to outside."}],"source_content_type":"text/x-rst","patch_set":14,"id":"fa69d971_331328ba","line":235,"range":{"start_line":235,"start_character":45,"end_line":235,"end_character":47},"updated":"2016-01-11 16:34:42.000000000","message":"nit a \u003d\u003e an","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"3b020212677cdb6345a31e80ca51c6aff3489b87","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can get from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other left callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate a ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"},{"line_number":237,"context_line":"PRECOMMIT_XXX, notify process will raise unified PrecommitCallbackFailure exception. For the"},{"line_number":238,"context_line":"exception triggered from other events, like AFTER_XXX, there will no exception raised to outside."}],"source_content_type":"text/x-rst","patch_set":14,"id":"da6ed579_ecb4f635","line":235,"range":{"start_line":235,"start_character":45,"end_line":235,"end_character":47},"in_reply_to":"fa69d971_331328ba","updated":"2016-01-14 05:48:20.000000000","message":"Done","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"52a389ad118a218ea811c11dd19a23640e28e7ad","unresolved":false,"context_lines":[{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate an ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"},{"line_number":237,"context_line":"PRECOMMIT_XXX, notify process will raise unified PrecommitCallbackFailure exception. For the"},{"line_number":238,"context_line":"exception triggered from other events, like AFTER_XXX, there will no exception raised to outside."},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"Unsubscribing to events"}],"source_content_type":"text/x-rst","patch_set":17,"id":"9a68dd71_375b5289","line":238,"updated":"2016-01-22 08:46:04.000000000","message":"this description seems outdated.","commit_id":"b680d722734c5786bbc87a31d0205bb6da1cebe3"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"13025dcb7a5c40895ff27db4268643222eca3174","unresolved":false,"context_lines":[{"line_number":235,"context_line":"BEFORE_XXX will make notify process generate an ABORT_XXX event and call its callback, and finally"},{"line_number":236,"context_line":"raise a unified CallbackFailure exception to outside. But for exception triggered in"},{"line_number":237,"context_line":"PRECOMMIT_XXX, notify process will raise unified PrecommitCallbackFailure exception. For the"},{"line_number":238,"context_line":"exception triggered from other events, like AFTER_XXX, there will no exception raised to outside."},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"Unsubscribing to events"}],"source_content_type":"text/x-rst","patch_set":17,"id":"9a68dd71_ee3357f4","line":238,"in_reply_to":"9a68dd71_375b5289","updated":"2016-01-27 02:44:41.000000000","message":"Done","commit_id":"b680d722734c5786bbc87a31d0205bb6da1cebe3"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"3dd1364a81dfebf951184670cc77011b155acf4d","unresolved":false,"context_lines":[{"line_number":377,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking functions or a function"},{"line_number":378,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":379,"context_line":"  Callbacks for PRECOMMIT events are meant to execute DB operations in a transaction context, the"},{"line_number":380,"context_line":"  errors occured will be taken care by the context manager."},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"What kind of function can be a callback?"},{"line_number":383,"context_line":""}],"source_content_type":"text/x-rst","patch_set":19,"id":"9a68dd71_2ff1f16a","line":380,"updated":"2016-01-27 08:13:29.000000000","message":"in case of PRECOMMIT_xxx failure, ABORT_xxx is called inside a transaction, right?","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5bb76119529452af63f1f11d85516a82664017fc","unresolved":false,"context_lines":[{"line_number":377,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking functions or a function"},{"line_number":378,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":379,"context_line":"  Callbacks for PRECOMMIT events are meant to execute DB operations in a transaction context, the"},{"line_number":380,"context_line":"  errors occured will be taken care by the context manager."},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"What kind of function can be a callback?"},{"line_number":383,"context_line":""}],"source_content_type":"text/x-rst","patch_set":19,"id":"9a68dd71_b83525dc","line":380,"in_reply_to":"9a68dd71_2ff1f16a","updated":"2016-01-27 10:12:45.000000000","message":"I think no, not sure if we need add it into it. Do you have some usecase?\nI make a wrong logic in neutron/callbacks/manager.py, I will revert it.","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"166472a73d20be18838a1dd17cc72d99dcb380ec","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can see from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other remaining callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"callback of BEFORE_XXX and PRECOMMIT_XXX will make notify process generate an ABORT_XXX event and"},{"line_number":236,"context_line":"call abort callback, and finally raise a unified CallbackFailure exception to outside. For the"},{"line_number":237,"context_line":"exception triggered from other events, like AFTER_XXX, there will no exception raised to outside."},{"line_number":238,"context_line":""}],"source_content_type":"text/x-rst","patch_set":20,"id":"7a5de9d1_43aa3972","line":235,"updated":"2016-01-27 13:02:15.000000000","message":"This is out of date now. The PRECOMMIT_XXX will not generate an ABORT_XXX event, right?\n\nThe final exception raised is different too.","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"76c97875b95042edd2105c4337db99335d8e88f4","unresolved":false,"context_lines":[{"line_number":232,"context_line":""},{"line_number":233,"context_line":"As we can see from the last example, exception which is triggered in some callback will be"},{"line_number":234,"context_line":"recorded, and it will not prevent the other remaining callbacks execution. Exception triggered in"},{"line_number":235,"context_line":"callback of BEFORE_XXX and PRECOMMIT_XXX will make notify process generate an ABORT_XXX event and"},{"line_number":236,"context_line":"call abort callback, and finally raise a unified CallbackFailure exception to outside. For the"},{"line_number":237,"context_line":"exception triggered from other events, like AFTER_XXX, there will no exception raised to outside."},{"line_number":238,"context_line":""}],"source_content_type":"text/x-rst","patch_set":20,"id":"7a5de9d1_60c70713","line":235,"in_reply_to":"7a5de9d1_43aa3972","updated":"2016-01-28 02:42:22.000000000","message":"Done","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0f0352a295af0bd6a563b7657ab281bb81ec94c8","unresolved":false,"context_lines":[{"line_number":375,"context_line":""},{"line_number":376,"context_line":"What kind of operation I can add into callback?"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":379,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking functions or a function"},{"line_number":380,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":381,"context_line":"  Callbacks for PRECOMMIT events are meant to execute DB operations in a transaction context, the"}],"source_content_type":"text/x-rst","patch_set":24,"id":"5a5ae5dd_b3401b09","line":378,"range":{"start_line":378,"start_character":20,"end_line":378,"end_character":44},"updated":"2016-02-03 08:08:14.000000000","message":"currently callbacks for these events can be called inside a transaction.\neg. ml2 update_subnet calls the base class\u0027 update_subnet, which generates these events, within a transaction.","commit_id":"27f0c8f2358ff003dfa934c69d6674cc8cf0644a"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"2cbd086bdbd38c461cd2049519af38b008e51111","unresolved":false,"context_lines":[{"line_number":375,"context_line":""},{"line_number":376,"context_line":"What kind of operation I can add into callback?"},{"line_number":377,"context_line":""},{"line_number":378,"context_line":"  No limitation for BEFORE_XXX and AFTER_XXX events. They are outside of the DB transaction. But"},{"line_number":379,"context_line":"  for callback function of PRECOMMIT_XXX events, we can\u0027t use blocking functions or a function"},{"line_number":380,"context_line":"  that would take a long time, like communicating to SDN controller over network."},{"line_number":381,"context_line":"  Callbacks for PRECOMMIT events are meant to execute DB operations in a transaction context, the"}],"source_content_type":"text/x-rst","patch_set":24,"id":"5a5ae5dd_62f9664d","line":378,"range":{"start_line":378,"start_character":20,"end_line":378,"end_character":44},"in_reply_to":"5a5ae5dd_b3401b09","updated":"2016-02-03 10:04:24.000000000","message":"Thanks for reminder. will update it.","commit_id":"27f0c8f2358ff003dfa934c69d6674cc8cf0644a"}],"neutron/callbacks/events.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9636fc4f9e19947e5a30a92a349de71924169096","unresolved":false,"context_lines":[{"line_number":17,"context_line":"BEFORE_UPDATE \u003d \u0027before_update\u0027"},{"line_number":18,"context_line":"PRECOMMIT_UPDATE \u003d \u0027precommit_update\u0027"},{"line_number":19,"context_line":"BEFORE_DELETE \u003d \u0027before_delete\u0027"},{"line_number":20,"context_line":"PRECOMMIT_DELETE\u003d \u0027precommit_delete\u0027"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"AFTER_CREATE \u003d \u0027after_create\u0027"},{"line_number":23,"context_line":"AFTER_READ \u003d \u0027after_read\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_2b790394","line":20,"updated":"2015-12-03 20:44:53.000000000","message":"Follow the existing layout.\ni.e. group PRECOMMIT_xxx","commit_id":"f5f25735925e2bebf50b4e1cba91e96f17a1f4e4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"d0f3148cb0db520bb36453b680e802e484cfffc6","unresolved":false,"context_lines":[{"line_number":17,"context_line":"BEFORE_UPDATE \u003d \u0027before_update\u0027"},{"line_number":18,"context_line":"PRECOMMIT_UPDATE \u003d \u0027precommit_update\u0027"},{"line_number":19,"context_line":"BEFORE_DELETE \u003d \u0027before_delete\u0027"},{"line_number":20,"context_line":"PRECOMMIT_DELETE\u003d \u0027precommit_delete\u0027"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"AFTER_CREATE \u003d \u0027after_create\u0027"},{"line_number":23,"context_line":"AFTER_READ \u003d \u0027after_read\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_26ecd5c6","line":20,"in_reply_to":"7a740942_2b790394","updated":"2015-12-04 04:18:59.000000000","message":"Done","commit_id":"f5f25735925e2bebf50b4e1cba91e96f17a1f4e4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fdfd73c432b45f883ffa989ce59c8dc821f858c1","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"PRECOMMIT_CREATE \u003d \u0027precommit_create\u0027"},{"line_number":30,"context_line":"PRECOMMIT_UPDATE \u003d \u0027precommit_update\u0027"},{"line_number":31,"context_line":"PRECOMMIT_DELETE \u003d \u0027precommit_delete\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_21ba4d6f","line":31,"updated":"2015-12-04 19:20:19.000000000","message":"move these after line 16","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"ff065df037361f4fe34c1018dc8bed053078a9dd","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"PRECOMMIT_CREATE \u003d \u0027precommit_create\u0027"},{"line_number":30,"context_line":"PRECOMMIT_UPDATE \u003d \u0027precommit_update\u0027"},{"line_number":31,"context_line":"PRECOMMIT_DELETE \u003d \u0027precommit_delete\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_57163ba8","line":31,"in_reply_to":"7a740942_21ba4d6f","updated":"2015-12-04 20:56:29.000000000","message":"yes, Done","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"bb5f97aaeb4a90daf949110d95e6472b99f07687","unresolved":false,"context_lines":[{"line_number":16,"context_line":"BEFORE_UPDATE \u003d \u0027before_update\u0027"},{"line_number":17,"context_line":"BEFORE_DELETE \u003d \u0027before_delete\u0027"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"PRECOMMIT_CREATE \u003d \u0027precommit_create\u0027"},{"line_number":20,"context_line":"PRECOMMIT_UPDATE \u003d \u0027precommit_update\u0027"},{"line_number":21,"context_line":"PRECOMMIT_DELETE \u003d \u0027precommit_delete\u0027"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a740942_d91cd615","line":19,"updated":"2015-12-09 19:18:44.000000000","message":"Note: the callback mechanism is being moved to neutron-lib, so these changes will be needed there, once review 253661 upstreams, so we don\u0027t miss the change.","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5ed738ecaff58b5d4c7f8d515dfba17caad9c0a5","unresolved":false,"context_lines":[{"line_number":16,"context_line":"BEFORE_UPDATE \u003d \u0027before_update\u0027"},{"line_number":17,"context_line":"BEFORE_DELETE \u003d \u0027before_delete\u0027"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"PRECOMMIT_CREATE \u003d \u0027precommit_create\u0027"},{"line_number":20,"context_line":"PRECOMMIT_UPDATE \u003d \u0027precommit_update\u0027"},{"line_number":21,"context_line":"PRECOMMIT_DELETE \u003d \u0027precommit_delete\u0027"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a740942_f42de2fd","line":19,"in_reply_to":"7a740942_d91cd615","updated":"2015-12-10 16:21:12.000000000","message":"thanks for pointing it out!","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"26a49d844110e2e4e4d47cc361f0189dabd6122f","unresolved":false,"context_lines":[{"line_number":31,"context_line":"ABORT_DELETE \u003d \u0027abort_delete\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_70bbd30f","line":34,"updated":"2015-12-13 09:48:56.000000000","message":"i think you want to make the callback manager handle exceptions for precommit events similarly to BEFORE ones.\n\nsee https://github.com/openstack/neutron/blob/dbc541be5428e092315ed3b51fa2295a5ea49068/neutron/callbacks/manager.py#L119","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7c856ce6b977159d73688cc3f8302f76de587724","unresolved":false,"context_lines":[{"line_number":31,"context_line":"ABORT_DELETE \u003d \u0027abort_delete\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_ec4c7e78","line":34,"in_reply_to":"5a710552_362c1eab","updated":"2015-12-14 20:22:36.000000000","message":"It\u0027s my understanding that PRECOMMIT events should be raised to allow callbacks to make DB (and only DB) operations in an atomic fashion. They should be designed to avoid failure. If the transaction fails, the atomic operation is rolled back automatically.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"9e1623294e2882bea4b6ccd53c2d59ec04bb9194","unresolved":false,"context_lines":[{"line_number":31,"context_line":"ABORT_DELETE \u003d \u0027abort_delete\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_dee603e8","line":34,"in_reply_to":"5a710552_ec4c7e78","updated":"2015-12-14 23:45:14.000000000","message":"the key of that callback manager handle the exception is insert the ABORT_XXX event.\n\nIf precommit event callback got a failure, do we need the emit the ABORT_XXX ?\nSuppose that controller side get the BEFORE_XXX successfully but neutron side failed in PRECOMMIT_XXX, maybe we need inform the controller with this synchronous way.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"93d4cf2626a09f87e8f1983b63442b312cb5ca6d","unresolved":false,"context_lines":[{"line_number":31,"context_line":"ABORT_DELETE \u003d \u0027abort_delete\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_362c1eab","line":34,"in_reply_to":"7a740942_4e012f04","updated":"2015-12-14 18:34:43.000000000","message":"In AFTER case, the db operation is already committed.\nWe can\u0027t fail with AFTER.\nBut we can fail with BEFORE and PRECOMMIT.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"07765ff09a1924478833456120a8aa633bdb6740","unresolved":false,"context_lines":[{"line_number":31,"context_line":"ABORT_DELETE \u003d \u0027abort_delete\u0027"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_4e012f04","line":34,"in_reply_to":"7a740942_70bbd30f","updated":"2015-12-14 15:31:21.000000000","message":"make sense, \n\nwhy AFTER ones don\u0027t need a check and abort?","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77e0881e68a6ad714e150e716deb5cbd77a6fd0b","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"},{"line_number":35,"context_line":"PRECOMMIT \u003d \u0027precommit_\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_766dbd31","line":35,"range":{"start_line":35,"start_character":13,"end_line":35,"end_character":23},"updated":"2015-12-17 01:12:00.000000000","message":"no need for this one, please remove.","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"18ece592fc7e7b823e887fc02c63860c6bbf80c0","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"},{"line_number":35,"context_line":"PRECOMMIT \u003d \u0027precommit_\u0027"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_4dfc2e72","line":35,"range":{"start_line":35,"start_character":13,"end_line":35,"end_character":23},"in_reply_to":"3a7e1126_766dbd31","updated":"2015-12-18 16:04:40.000000000","message":"Done","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"55ae8a8fb77cbff7c2d9a325b8cb9f3fcfaf639a","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"},{"line_number":35,"context_line":"PRECOMMIT \u003d \u0027precommit_\u0027"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a5de9d1_c9ae6e2d","line":35,"range":{"start_line":35,"start_character":0,"end_line":35,"end_character":9},"updated":"2016-02-01 20:58:48.000000000","message":"do you still use this one? Can\u0027t seem to find it, but I have seen this patch too many times to see straight :)","commit_id":"b3c1d030b1645c7d5daa642f0ff8816da7cb923c"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"0b9ac42b752abf0482f8a5b796044255b91280ec","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"ABORT \u003d \u0027abort_\u0027"},{"line_number":34,"context_line":"BEFORE \u003d \u0027before_\u0027"},{"line_number":35,"context_line":"PRECOMMIT \u003d \u0027precommit_\u0027"}],"source_content_type":"text/x-python","patch_set":22,"id":"7a5de9d1_b687c6b3","line":35,"range":{"start_line":35,"start_character":0,"end_line":35,"end_character":9},"in_reply_to":"7a5de9d1_c9ae6e2d","updated":"2016-02-02 01:38:48.000000000","message":"thanks, I will remove it.","commit_id":"b3c1d030b1645c7d5daa642f0ff8816da7cb923c"}],"neutron/callbacks/exceptions.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d0499db7c8d41967c609a07f720e2ded19e871d7","unresolved":false,"context_lines":[{"line_number":30,"context_line":"            return str(self.errors)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class PRECOMMIT_CallbackFailure(CallbackFailure):"},{"line_number":34,"context_line":"    pass"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"fa69d971_9444901b","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":15},"updated":"2016-01-08 13:58:50.000000000","message":"nit: I don\u0027t think we need to abandon the normal CamelCase for this.","commit_id":"69efe25293f27d2f67b0484ee941a3a68cf0c962"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"f748c3f4ea1c939885e1ede037d805768ff457f7","unresolved":false,"context_lines":[{"line_number":30,"context_line":"            return str(self.errors)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class PRECOMMIT_CallbackFailure(CallbackFailure):"},{"line_number":34,"context_line":"    pass"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"fa69d971_e373b07e","line":33,"range":{"start_line":33,"start_character":6,"end_line":33,"end_character":15},"in_reply_to":"fa69d971_9444901b","updated":"2016-01-09 07:40:21.000000000","message":"Done","commit_id":"69efe25293f27d2f67b0484ee941a3a68cf0c962"}],"neutron/callbacks/manager.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77e0881e68a6ad714e150e716deb5cbd77a6fd0b","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        :param trigger: the trigger. A reference to the sender of the event."},{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors and (event.startswith(events.BEFORE) or event.startswith("},{"line_number":120,"context_line":"                       events.PRECOMMIT)):"},{"line_number":121,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":122,"context_line":"                abort_event \u003d event.replace(events.BEFORE, events.ABORT)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_f6ed2d8f","line":119,"range":{"start_line":119,"start_character":28,"end_line":119,"end_character":29},"updated":"2015-12-17 01:12:00.000000000","message":"please revert these changes, as mentioned elsewhere, callbacks to BEFORE_COMMIT events are meant to execute db operations only. DB Errors are triggered only when committing the transaction, so this code will never be reached (for that class of errors). Other programmatic errors should be caught through unit tests, therefore there is no need to provide an abort mechanism, because that\u0027s what the transaction\u0027s rollback is for.","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"18ece592fc7e7b823e887fc02c63860c6bbf80c0","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        :param trigger: the trigger. A reference to the sender of the event."},{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors and (event.startswith(events.BEFORE) or event.startswith("},{"line_number":120,"context_line":"                       events.PRECOMMIT)):"},{"line_number":121,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":122,"context_line":"                abort_event \u003d event.replace(events.BEFORE, events.ABORT)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_17e07328","line":119,"range":{"start_line":119,"start_character":28,"end_line":119,"end_character":29},"in_reply_to":"3a7e1126_f6ed2d8f","updated":"2015-12-18 16:04:40.000000000","message":"thanks armax, I will revert it.","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"d0499db7c8d41967c609a07f720e2ded19e871d7","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        :param trigger: the trigger. A reference to the sender of the event."},{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors:"},{"line_number":120,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":121,"context_line":"                abort_event \u003d event.replace("},{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa69d971_d4e0c8ce","line":119,"updated":"2016-01-08 13:58:50.000000000","message":"The devref documentation should be updated to indicate the change in functionality of notify (that it will raise an exception for precommit errors, and that there is a new event type).\n\nNote: Corresponding changes should be made to the callback code in the neutron-lib project.","commit_id":"69efe25293f27d2f67b0484ee941a3a68cf0c962"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"f748c3f4ea1c939885e1ede037d805768ff457f7","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        :param trigger: the trigger. A reference to the sender of the event."},{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors:"},{"line_number":120,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":121,"context_line":"                abort_event \u003d event.replace("},{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa69d971_a3f93850","line":119,"in_reply_to":"fa69d971_d4e0c8ce","updated":"2016-01-09 07:40:21.000000000","message":"make sense, I will update the callbacks.rst and the commit msg.","commit_id":"69efe25293f27d2f67b0484ee941a3a68cf0c962"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"41b59cdd0dd3b15a8cfedaddcfdf98e7739b95b9","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors:"},{"line_number":120,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":121,"context_line":"                abort_event \u003d event.replace("},{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"                self._notify_loop(resource, abort_event, trigger)"}],"source_content_type":"text/x-python","patch_set":16,"id":"da6ed579_f75c43f2","line":120,"updated":"2016-01-16 03:49:03.000000000","message":"put it back, please. I see no reason why this is more readable.\n\nIf you hadn\u0027t it, the patch wouldn\u0027t have conflicted.","commit_id":"9862a02bda8f13932b83850f5bbb8863a4e36d80"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"0f185063afe90bd14064d83af777aa3c9b8340c1","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors:"},{"line_number":120,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":121,"context_line":"                abort_event \u003d event.replace("},{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"                self._notify_loop(resource, abort_event, trigger)"}],"source_content_type":"text/x-python","patch_set":16,"id":"da6ed579_4730e107","line":120,"in_reply_to":"da6ed579_f75c43f2","updated":"2016-01-18 01:40:06.000000000","message":"hi armax, if we move it back, exception will only be triggered by BEFORE event .","commit_id":"9862a02bda8f13932b83850f5bbb8863a4e36d80"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ad019ff80c830768e73bf1e486a766aa5f7b533e","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors and (event.startswith(events.BEFORE) or"},{"line_number":120,"context_line":"                       event.startswith(events.PRECOMMIT)):"},{"line_number":121,"context_line":"            abort_event \u003d event.replace("},{"line_number":122,"context_line":"                events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"            self._notify_loop(resource, abort_event, trigger, **kwargs)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_e62a5e7e","line":120,"range":{"start_line":120,"start_character":23,"end_line":120,"end_character":28},"updated":"2016-01-27 09:28:31.000000000","message":"can you please leave this file alone? I have been saying time and time again that this logic does not need to be altered!","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5bb76119529452af63f1f11d85516a82664017fc","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        \"\"\""},{"line_number":118,"context_line":"        errors \u003d self._notify_loop(resource, event, trigger, **kwargs)"},{"line_number":119,"context_line":"        if errors and (event.startswith(events.BEFORE) or"},{"line_number":120,"context_line":"                       event.startswith(events.PRECOMMIT)):"},{"line_number":121,"context_line":"            abort_event \u003d event.replace("},{"line_number":122,"context_line":"                events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"            self._notify_loop(resource, abort_event, trigger, **kwargs)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_26bb9610","line":120,"range":{"start_line":120,"start_character":23,"end_line":120,"end_character":28},"in_reply_to":"7a5de9d1_e62a5e7e","updated":"2016-01-27 10:12:45.000000000","message":"hello armax, I will refactor this logic.","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"3dd1364a81dfebf951184670cc77011b155acf4d","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        if errors and (event.startswith(events.BEFORE) or"},{"line_number":120,"context_line":"                       event.startswith(events.PRECOMMIT)):"},{"line_number":121,"context_line":"            abort_event \u003d event.replace("},{"line_number":122,"context_line":"                events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"            self._notify_loop(resource, abort_event, trigger, **kwargs)"},{"line_number":124,"context_line":"            raise exceptions.CallbackFailure(errors\u003derrors)"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"9a68dd71_4ffc653e","line":122,"updated":"2016-01-27 08:13:29.000000000","message":"this replace() doesn\u0027t work for PRECOMMIT case.","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5bb76119529452af63f1f11d85516a82664017fc","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        if errors and (event.startswith(events.BEFORE) or"},{"line_number":120,"context_line":"                       event.startswith(events.PRECOMMIT)):"},{"line_number":121,"context_line":"            abort_event \u003d event.replace("},{"line_number":122,"context_line":"                events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"            self._notify_loop(resource, abort_event, trigger, **kwargs)"},{"line_number":124,"context_line":"            raise exceptions.CallbackFailure(errors\u003derrors)"},{"line_number":125,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_a680e647","line":122,"in_reply_to":"9a68dd71_4ffc653e","updated":"2016-01-27 10:12:45.000000000","message":"will update it.","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"be7c7210efbd92c1a8a9b15f3e333079a442a1d8","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":121,"context_line":"                abort_event \u003d event.replace("},{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"                self._notify_loop(resource, abort_event, trigger)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"            raise exceptions.CallbackFailure(errors\u003derrors)"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_1af26d9b","line":123,"range":{"start_line":123,"start_character":56,"end_line":123,"end_character":57},"updated":"2016-01-27 10:59:50.000000000","message":"you reverted this change by mistake","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"166472a73d20be18838a1dd17cc72d99dcb380ec","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":121,"context_line":"                abort_event \u003d event.replace("},{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"                self._notify_loop(resource, abort_event, trigger)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"            raise exceptions.CallbackFailure(errors\u003derrors)"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_d016f154","line":123,"range":{"start_line":123,"start_character":56,"end_line":123,"end_character":57},"in_reply_to":"7a5de9d1_1af26d9b","updated":"2016-01-27 13:02:15.000000000","message":"+1","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"76c97875b95042edd2105c4337db99335d8e88f4","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            if event.startswith(events.BEFORE):"},{"line_number":121,"context_line":"                abort_event \u003d event.replace("},{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"                self._notify_loop(resource, abort_event, trigger)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"            raise exceptions.CallbackFailure(errors\u003derrors)"},{"line_number":126,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_a0773f01","line":123,"range":{"start_line":123,"start_character":56,"end_line":123,"end_character":57},"in_reply_to":"7a5de9d1_1af26d9b","updated":"2016-01-28 02:42:22.000000000","message":"Done","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0f0352a295af0bd6a563b7657ab281bb81ec94c8","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"                self._notify_loop(resource, abort_event, trigger, **kwargs)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"            raise exceptions.CallbackFailure(errors\u003derrors)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def clear(self):"},{"line_number":128,"context_line":"        \"\"\"Brings the manager to a clean slate.\"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"5a5ae5dd_737ce320","line":125,"updated":"2016-02-03 08:08:14.000000000","message":"doesn\u0027t this raise CallbackFailure for AFTER events?","commit_id":"27f0c8f2358ff003dfa934c69d6674cc8cf0644a"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"2cbd086bdbd38c461cd2049519af38b008e51111","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                    events.BEFORE, events.ABORT)"},{"line_number":123,"context_line":"                self._notify_loop(resource, abort_event, trigger, **kwargs)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"            raise exceptions.CallbackFailure(errors\u003derrors)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def clear(self):"},{"line_number":128,"context_line":"        \"\"\"Brings the manager to a clean slate.\"\"\""}],"source_content_type":"text/x-python","patch_set":24,"id":"5a5ae5dd_99541d55","line":125,"in_reply_to":"5a5ae5dd_737ce320","updated":"2016-02-03 10:04:24.000000000","message":"yes, I think we should raise CallbackFailure for AFTER events, because maybe exception all be covered by it.\nbut I agree that would be another patch.","commit_id":"27f0c8f2358ff003dfa934c69d6674cc8cf0644a"}],"neutron/db/securitygroups_db.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9636fc4f9e19947e5a30a92a349de71924169096","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return self._create_bulk(\u0027security_group\u0027, context,"},{"line_number":125,"context_line":"                                 security_group_rule)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _registry_notify(self, res, event, trigger, id\u003dNone, conv_ept\u003dNone,"},{"line_number":128,"context_line":"                         **kwargs):"},{"line_number":129,"context_line":"        try:"},{"line_number":130,"context_line":"            registry.notify(res, event, trigger, **kwargs)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_8b96f792","line":127,"updated":"2015-12-03 20:44:53.000000000","message":"nice refactoring.","commit_id":"f5f25735925e2bebf50b4e1cba91e96f17a1f4e4"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"9636fc4f9e19947e5a30a92a349de71924169096","unresolved":false,"context_lines":[{"line_number":626,"context_line":"                # MultipleResultsFound to be raised"},{"line_number":627,"context_line":"                context.session.delete(query.one())"},{"line_number":628,"context_line":"                self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":629,"context_line":"                                      events.PRECOMMIT_DELETE, self, **kwargs)"},{"line_number":630,"context_line":"            except exc.NoResultFound:"},{"line_number":631,"context_line":"                raise ext_sg.SecurityGroupRuleNotFound(id\u003did)"},{"line_number":632,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_ab6ad318","line":629,"updated":"2015-12-03 20:44:53.000000000","message":"ML2 case, delete precommit is issued before actual deletion of row.","commit_id":"f5f25735925e2bebf50b4e1cba91e96f17a1f4e4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"d0f3148cb0db520bb36453b680e802e484cfffc6","unresolved":false,"context_lines":[{"line_number":626,"context_line":"                # MultipleResultsFound to be raised"},{"line_number":627,"context_line":"                context.session.delete(query.one())"},{"line_number":628,"context_line":"                self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":629,"context_line":"                                      events.PRECOMMIT_DELETE, self, **kwargs)"},{"line_number":630,"context_line":"            except exc.NoResultFound:"},{"line_number":631,"context_line":"                raise ext_sg.SecurityGroupRuleNotFound(id\u003did)"},{"line_number":632,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a740942_4199c06d","line":629,"in_reply_to":"7a740942_ab6ad318","updated":"2015-12-04 04:18:59.000000000","message":"Done","commit_id":"f5f25735925e2bebf50b4e1cba91e96f17a1f4e4"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fdfd73c432b45f883ffa989ce59c8dc821f858c1","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return self._create_bulk(\u0027security_group\u0027, context,"},{"line_number":125,"context_line":"                                 security_group_rule)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _registry_notify(self, res, event, trigger, id\u003dNone, conv_ept\u003dNone,"},{"line_number":128,"context_line":"                         **kwargs):"},{"line_number":129,"context_line":"        try:"},{"line_number":130,"context_line":"            registry.notify(res, event, trigger, **kwargs)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_81822193","line":127,"updated":"2015-12-04 19:20:19.000000000","message":"is the trigger ever going to be different than self in this case? I wouldn\u0027t think so. But I think that this utility function is making readability worse. I\u0027d simply leave things as they are and expand what you need inline, the duplication is limited","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"ff065df037361f4fe34c1018dc8bed053078a9dd","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        return self._create_bulk(\u0027security_group\u0027, context,"},{"line_number":125,"context_line":"                                 security_group_rule)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def _registry_notify(self, res, event, trigger, id\u003dNone, conv_ept\u003dNone,"},{"line_number":128,"context_line":"                         **kwargs):"},{"line_number":129,"context_line":"        try:"},{"line_number":130,"context_line":"            registry.notify(res, event, trigger, **kwargs)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_b2dc4de5","line":127,"in_reply_to":"7a740942_81822193","updated":"2015-12-04 20:56:29.000000000","message":"yes, I will delete the \u0027trigger\u0027 aguement and could that be able to make the readablility better?\n\ncreate this method just for save the same logic of except exception.","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fdfd73c432b45f883ffa989ce59c8dc821f858c1","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":188,"context_line":"                    ethertype\u003dethertype)"},{"line_number":189,"context_line":"                context.session.add(egress_rule)"},{"line_number":190,"context_line":"                self._registry_notify(resources.SECURITY_GROUP,"},{"line_number":191,"context_line":"                                      events.PRECOMMIT_CREATE, self, **kwargs)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        secgroup_dict \u003d self._make_security_group_dict(security_group_db)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_41199987","line":190,"updated":"2015-12-04 19:20:19.000000000","message":"If the callback fails, do you want to catch and do some processing or blindly reraise the exception?","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"ff065df037361f4fe34c1018dc8bed053078a9dd","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":188,"context_line":"                    ethertype\u003dethertype)"},{"line_number":189,"context_line":"                context.session.add(egress_rule)"},{"line_number":190,"context_line":"                self._registry_notify(resources.SECURITY_GROUP,"},{"line_number":191,"context_line":"                                      events.PRECOMMIT_CREATE, self, **kwargs)"},{"line_number":192,"context_line":""},{"line_number":193,"context_line":"        secgroup_dict \u003d self._make_security_group_dict(security_group_db)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_74ca5270","line":190,"in_reply_to":"7a740942_41199987","updated":"2015-12-04 20:56:29.000000000","message":"it\u0027s like other events, they will reraise the exception if it\u0027s not CallbackFailure.","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fdfd73c432b45f883ffa989ce59c8dc821f858c1","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                        id\u003did, conv_ept\u003dext_sg.SecurityGroupInUse, **kwargs)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":280,"context_line":"            self._registry_notify(resources.SECURITY_GROUP,"},{"line_number":281,"context_line":"                                  events.PRECOMMIT_DELETE, self, **kwargs)"},{"line_number":282,"context_line":"            context.session.delete(sg)"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_5c2ae27f","line":280,"updated":"2015-12-04 19:20:19.000000000","message":"We should be consistent and add the notification either before the actual db operation or after. You did after for create, we should do the same here too. The object should is still available in the session. You might want to consider a utility context manager that sends the notification, but it\u0027s probably overkill right now.","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"0a5d19c259b9b39bd8afd1104438f67ee920df31","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                        id\u003did, conv_ept\u003dext_sg.SecurityGroupInUse, **kwargs)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":280,"context_line":"            self._registry_notify(resources.SECURITY_GROUP,"},{"line_number":281,"context_line":"                                  events.PRECOMMIT_DELETE, self, **kwargs)"},{"line_number":282,"context_line":"            context.session.delete(sg)"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_752e41fc","line":280,"in_reply_to":"7a740942_12b8c1e4","updated":"2015-12-08 20:08:26.000000000","message":"This ordering is intentionally kept same to ML2.\nML2 imposes\n- precommit after creation/update\n- precommit before deletion\n\nIn deletion case,  there may a db row that has foreign key to security group. which must be deleted before deletion.","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"ff065df037361f4fe34c1018dc8bed053078a9dd","unresolved":false,"context_lines":[{"line_number":277,"context_line":"                        id\u003did, conv_ept\u003dext_sg.SecurityGroupInUse, **kwargs)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":280,"context_line":"            self._registry_notify(resources.SECURITY_GROUP,"},{"line_number":281,"context_line":"                                  events.PRECOMMIT_DELETE, self, **kwargs)"},{"line_number":282,"context_line":"            context.session.delete(sg)"},{"line_number":283,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_12b8c1e4","line":280,"in_reply_to":"7a740942_5c2ae27f","updated":"2015-12-04 20:56:29.000000000","message":"thanks armax, I am not sure, but maybe the callback need the sg info in db first, or maybe some foreign key used not with ondelete\u003d\"CASCADE\".","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"fdfd73c432b45f883ffa989ce59c8dc821f858c1","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                SecurityGroupRule.id \u003d\u003d id)"},{"line_number":625,"context_line":"            try:"},{"line_number":626,"context_line":"                self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":627,"context_line":"                                      events.PRECOMMIT_DELETE, self, **kwargs)"},{"line_number":628,"context_line":"                # As there is a filter on a primary key it is not possible for"},{"line_number":629,"context_line":"                # MultipleResultsFound to be raised"},{"line_number":630,"context_line":"                context.session.delete(query.one())"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_9c304aea","line":627,"updated":"2015-12-04 19:20:19.000000000","message":"ditto","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"ff065df037361f4fe34c1018dc8bed053078a9dd","unresolved":false,"context_lines":[{"line_number":624,"context_line":"                SecurityGroupRule.id \u003d\u003d id)"},{"line_number":625,"context_line":"            try:"},{"line_number":626,"context_line":"                self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":627,"context_line":"                                      events.PRECOMMIT_DELETE, self, **kwargs)"},{"line_number":628,"context_line":"                # As there is a filter on a primary key it is not possible for"},{"line_number":629,"context_line":"                # MultipleResultsFound to be raised"},{"line_number":630,"context_line":"                context.session.delete(query.one())"}],"source_content_type":"text/x-python","patch_set":3,"id":"7a740942_b2cf6d7e","line":627,"in_reply_to":"7a740942_9c304aea","updated":"2015-12-04 20:56:29.000000000","message":"ditto","commit_id":"51b99dd3973754baa3c712260c233f1c07c542f1"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0676e9ccd69175f5d427ab8fb4d1c1eac625017e","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            sg.update(s)"},{"line_number":310,"context_line":"            registry.notify("},{"line_number":311,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_UPDATE, self,"},{"line_number":312,"context_line":"                **kwargs)"},{"line_number":313,"context_line":"        sg_dict \u003d self._make_security_group_dict(sg)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        kwargs[\u0027security_group\u0027] \u003d sg_dict"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a740942_02baec6e","line":312,"updated":"2015-12-09 16:25:32.000000000","message":"isn\u0027t it more useful to notify before updating the db row\nso that callbacks can inspect the values before an update?","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"317913d6eb9fd0144811c31470149c3bcacfb044","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            sg.update(s)"},{"line_number":310,"context_line":"            registry.notify("},{"line_number":311,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_UPDATE, self,"},{"line_number":312,"context_line":"                **kwargs)"},{"line_number":313,"context_line":"        sg_dict \u003d self._make_security_group_dict(sg)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        kwargs[\u0027security_group\u0027] \u003d sg_dict"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a740942_0fe2f39f","line":312,"in_reply_to":"7a740942_02baec6e","updated":"2015-12-10 07:45:07.000000000","message":"In that case, do we want precommit_update_before/after?","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5ed738ecaff58b5d4c7f8d515dfba17caad9c0a5","unresolved":false,"context_lines":[{"line_number":309,"context_line":"            sg.update(s)"},{"line_number":310,"context_line":"            registry.notify("},{"line_number":311,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_UPDATE, self,"},{"line_number":312,"context_line":"                **kwargs)"},{"line_number":313,"context_line":"        sg_dict \u003d self._make_security_group_dict(sg)"},{"line_number":314,"context_line":""},{"line_number":315,"context_line":"        kwargs[\u0027security_group\u0027] \u003d sg_dict"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a740942_c3a026a8","line":312,"in_reply_to":"7a740942_0fe2f39f","updated":"2015-12-10 16:21:12.000000000","message":"@yamamoto, I think it \u0027before\u0027 make sense, \n@yamahato, is there a usecase that we need another \u0027after\u0027? does the info storged in \u0027s\u0027 here is same as the db? or do you mean some other related foreign key tables?","commit_id":"6bca7e89719241e9ab73ffe8d7d6a3e3a30ddd01"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"cb3809b9847a0aac598c4e3774d1d993e7ee9e35","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_446e6e30","line":182,"updated":"2015-12-10 21:51:42.000000000","message":"wondering if we should add comment to indicate that subscribers to these must not do RPC, or is that obvious?","commit_id":"3385c0ae7c74de868bb0aecf4c8dc4e60a27890e"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"c7c981fb75671b74ae2904d0b91575f045a9b919","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_42aaa672","line":182,"in_reply_to":"7a740942_446e6e30","updated":"2015-12-11 20:26:43.000000000","message":"I think that\u0027s what precommit means.","commit_id":"3385c0ae7c74de868bb0aecf4c8dc4e60a27890e"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"cb3809b9847a0aac598c4e3774d1d993e7ee9e35","unresolved":false,"context_lines":[{"line_number":307,"context_line":"            if sg[\u0027name\u0027] \u003d\u003d \u0027default\u0027 and \u0027name\u0027 in s:"},{"line_number":308,"context_line":"                raise ext_sg.SecurityGroupCannotUpdateDefault()"},{"line_number":309,"context_line":"            sg.update(s)"},{"line_number":310,"context_line":"            registry.notify("},{"line_number":311,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_UPDATE, self,"},{"line_number":312,"context_line":"                **kwargs)"},{"line_number":313,"context_line":"        sg_dict \u003d self._make_security_group_dict(sg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_e4f19a6b","line":310,"updated":"2015-12-10 21:51:42.000000000","message":"Were you going to move this before the update?","commit_id":"3385c0ae7c74de868bb0aecf4c8dc4e60a27890e"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"c7c981fb75671b74ae2904d0b91575f045a9b919","unresolved":false,"context_lines":[{"line_number":307,"context_line":"            if sg[\u0027name\u0027] \u003d\u003d \u0027default\u0027 and \u0027name\u0027 in s:"},{"line_number":308,"context_line":"                raise ext_sg.SecurityGroupCannotUpdateDefault()"},{"line_number":309,"context_line":"            sg.update(s)"},{"line_number":310,"context_line":"            registry.notify("},{"line_number":311,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_UPDATE, self,"},{"line_number":312,"context_line":"                **kwargs)"},{"line_number":313,"context_line":"        sg_dict \u003d self._make_security_group_dict(sg)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7a740942_424626c1","line":310,"in_reply_to":"7a740942_e4f19a6b","updated":"2015-12-11 20:26:43.000000000","message":"thanks, done! I am waiting for more comments here, because seems ML2 put update_port_precommit after the db operation in the transaction.","commit_id":"3385c0ae7c74de868bb0aecf4c8dc4e60a27890e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ecfa94604867d5808b60385ea23ac53be9427fb6","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_edc60c9b","line":182,"updated":"2015-12-13 07:35:21.000000000","message":"i have concerns about this being done in a db transaction","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7c856ce6b977159d73688cc3f8302f76de587724","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_ec81de4e","line":182,"in_reply_to":"5a710552_216296d9","updated":"2015-12-14 20:22:36.000000000","message":"See my message to events.py\n\nPRECOMMIT events are meant to be introduced to allow for DB (and only for DB) operations to be done in the same transaction context. Rollback is taken care of by the context manager.\n\nYou can add a Q\u0026A section dedicated to PRECOMMIT here:\n\nhttps://github.com/openstack/neutron/blob/master/doc/source/devref/callbacks.rst#faq","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"9e1623294e2882bea4b6ccd53c2d59ec04bb9194","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_9ef87b7e","line":182,"in_reply_to":"5a710552_ec81de4e","updated":"2015-12-14 23:45:14.000000000","message":"thanks Armax!","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"42cf346671e3a1e8c2c91184c845a4a02b065f9d","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_cfdf5967","line":182,"in_reply_to":"7a740942_3693005d","updated":"2015-12-14 16:00:27.000000000","message":"Doc yes, and you could add a comment, unless it is obvious to everyone not to make RPC calls in the callback.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"dde5e70735a2fb1e93357de84de1c3e9c222c729","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_6bc1a42e","line":182,"in_reply_to":"7a740942_50a1f7f6","updated":"2015-12-13 11:46:58.000000000","message":"will a rpc or some backend call be done by this callback?","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"908eee6a9abda252b82a54e67d4a42cb6fa527d9","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_f0049818","line":182,"in_reply_to":"7a740942_6bc1a42e","updated":"2015-12-14 03:57:01.000000000","message":"it shouldn\u0027t.\n\nthe rule should be same as ML2 driver precommit methods.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"07765ff09a1924478833456120a8aa633bdb6740","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_3693005d","line":182,"in_reply_to":"7a740942_6bc1a42e","updated":"2015-12-14 15:31:21.000000000","message":"thanks garyk, I think rpc call would subscribe to BEFORE_XXX. Maybe warning should be added to doc?","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"93d4cf2626a09f87e8f1983b63442b312cb5ca6d","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"5a710552_216296d9","line":182,"in_reply_to":"7a740942_cfdf5967","updated":"2015-12-14 18:34:43.000000000","message":"+1 for documentation.\n\nThis rule applies to not only RPC, but also something that can (potentially) take long time except db operation.\ne.g. communicating to SDN controller over network.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"26a49d844110e2e4e4d47cc361f0189dabd6122f","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                    direction\u003d\u0027egress\u0027,"},{"line_number":180,"context_line":"                    ethertype\u003dethertype)"},{"line_number":181,"context_line":"                context.session.add(egress_rule)"},{"line_number":182,"context_line":"                registry.notify("},{"line_number":183,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":184,"context_line":"                    **kwargs)"},{"line_number":185,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_50a1f7f6","line":182,"in_reply_to":"7a740942_edc60c9b","updated":"2015-12-13 09:48:56.000000000","message":"garyk, can you explain your concerns?\nbeing in a transaction is the main point of this change.","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ecfa94604867d5808b60385ea23ac53be9427fb6","unresolved":false,"context_lines":[{"line_number":275,"context_line":"            raise ext_sg.SecurityGroupInUse(id\u003did, reason\u003dreason)"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":278,"context_line":"            registry.notify("},{"line_number":279,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_DELETE, self,"},{"line_number":280,"context_line":"                **kwargs)"},{"line_number":281,"context_line":"            context.session.delete(sg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_0dccb8b9","line":278,"updated":"2015-12-13 07:35:21.000000000","message":"ditto","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ecfa94604867d5808b60385ea23ac53be9427fb6","unresolved":false,"context_lines":[{"line_number":637,"context_line":"            query \u003d self._model_query(context, SecurityGroupRule).filter("},{"line_number":638,"context_line":"                SecurityGroupRule.id \u003d\u003d id)"},{"line_number":639,"context_line":"            try:"},{"line_number":640,"context_line":"                registry.notify("},{"line_number":641,"context_line":"                    resources.SECURITY_GROUP_RULE, events.PRECOMMIT_DELETE,"},{"line_number":642,"context_line":"                    self, **kwargs)"},{"line_number":643,"context_line":"                # As there is a filter on a primary key it is not possible for"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_adc5648e","line":640,"updated":"2015-12-13 07:35:21.000000000","message":"ditto","commit_id":"485e697a5847729e13956555fd8590167d3d1dec"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"d93f303f23e67253b8a882dbaa0b3b1af7a06392","unresolved":false,"context_lines":[{"line_number":278,"context_line":"            raise ext_sg.SecurityGroupInUse(id\u003did, reason\u003dreason)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":281,"context_line":"            registry.notify("},{"line_number":282,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_DELETE, self,"},{"line_number":283,"context_line":"                **kwargs)"},{"line_number":284,"context_line":"            context.session.delete(sg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a7b0d38_f5c41a41","line":281,"updated":"2015-12-23 15:40:33.000000000","message":"this still concerns me. i know that you have written in the doc. So if I understand correctly you want to do some kind of DB update on your side too.\nI understand that this is something which is blocking you guys.\nI think that maybe if you change the name from the PRECOMMIT_DELETE to PRECOMMIT_DELETE_IN_TRANSACTION then it may be a way forwards. At least that lets me know as someone invoking this that it is in a DB transaction","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"cee3d71c7b131eb8f7c7447ef5da19dbd220d92e","unresolved":false,"context_lines":[{"line_number":278,"context_line":"            raise ext_sg.SecurityGroupInUse(id\u003did, reason\u003dreason)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":281,"context_line":"            registry.notify("},{"line_number":282,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_DELETE, self,"},{"line_number":283,"context_line":"                **kwargs)"},{"line_number":284,"context_line":"            context.session.delete(sg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa69d971_9719cbd9","line":281,"in_reply_to":"1a7b0d38_c37e03e4","updated":"2016-01-05 03:19:23.000000000","message":"thanks garyk and armax, agree that PRECOMMIT_ prefix is just for the meaning that it\u0027s inside of a transaction, which different from the POSTCOMMIT_.","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"812968fb4253eb9f96a8c54df12709073ec73e27","unresolved":false,"context_lines":[{"line_number":278,"context_line":"            raise ext_sg.SecurityGroupInUse(id\u003did, reason\u003dreason)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":281,"context_line":"            registry.notify("},{"line_number":282,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_DELETE, self,"},{"line_number":283,"context_line":"                **kwargs)"},{"line_number":284,"context_line":"            context.session.delete(sg)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a7b0d38_c37e03e4","line":281,"in_reply_to":"1a7b0d38_f5c41a41","updated":"2015-12-23 18:26:22.000000000","message":"Isn\u0027t that what the PRECOMMIT_ prefix is for? IMO you\u0027re overreacting.","commit_id":"4ba6111c2d562f84559725a244532b38b7367232"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"52a389ad118a218ea811c11dd19a23640e28e7ad","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                context.session.add(egress_rule)"},{"line_number":185,"context_line":"                registry.notify("},{"line_number":186,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":187,"context_line":"                    **kwargs)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        secgroup_dict \u003d self._make_security_group_dict(security_group_db)"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a68dd71_72bb18e6","line":187,"updated":"2016-01-22 08:46:04.000000000","message":"can you translate CallbackFailure to something more meaningful than 500 for API users, as we do for BEFORE_*?","commit_id":"b680d722734c5786bbc87a31d0205bb6da1cebe3"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"13025dcb7a5c40895ff27db4268643222eca3174","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                context.session.add(egress_rule)"},{"line_number":185,"context_line":"                registry.notify("},{"line_number":186,"context_line":"                    resources.SECURITY_GROUP, events.PRECOMMIT_CREATE, self,"},{"line_number":187,"context_line":"                    **kwargs)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        secgroup_dict \u003d self._make_security_group_dict(security_group_db)"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9a68dd71_9e94d6e8","line":187,"in_reply_to":"9a68dd71_72bb18e6","updated":"2016-01-27 02:44:41.000000000","message":"Done","commit_id":"b680d722734c5786bbc87a31d0205bb6da1cebe3"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"3dd1364a81dfebf951184670cc77011b155acf4d","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        return self._create_bulk(\u0027security_group\u0027, context,"},{"line_number":128,"context_line":"                                 security_group_rule)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _registry_notify(self, res, event, id\u003dNone, conv_ept\u003dNone, **kwargs):"},{"line_number":131,"context_line":"        try:"},{"line_number":132,"context_line":"            registry.notify(res, event, self, **kwargs)"},{"line_number":133,"context_line":"        except exceptions.CallbackFailure as e:"}],"source_content_type":"text/x-python","patch_set":19,"id":"9a68dd71_8fb01d8d","line":130,"range":{"start_line":130,"start_character":52,"end_line":130,"end_character":60},"updated":"2016-01-27 08:13:29.000000000","message":"what \"ept\" stands for?\n\ni suggest exc_cls and exc_kwargs.","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5bb76119529452af63f1f11d85516a82664017fc","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        return self._create_bulk(\u0027security_group\u0027, context,"},{"line_number":128,"context_line":"                                 security_group_rule)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _registry_notify(self, res, event, id\u003dNone, conv_ept\u003dNone, **kwargs):"},{"line_number":131,"context_line":"        try:"},{"line_number":132,"context_line":"            registry.notify(res, event, self, **kwargs)"},{"line_number":133,"context_line":"        except exceptions.CallbackFailure as e:"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_e916b1a6","line":130,"range":{"start_line":130,"start_character":52,"end_line":130,"end_character":60},"in_reply_to":"9a68dd71_8fb01d8d","updated":"2016-01-27 10:12:45.000000000","message":"Thanks yamamoto, exc_cls make sense, but kwargs is not for a exception. it is used by callback funtions. may I keep it?","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"3dd1364a81dfebf951184670cc77011b155acf4d","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        # from being processed. This is a hook point for backend\u0027s validation;"},{"line_number":278,"context_line":"        # we raise to propagate the reason for the failure."},{"line_number":279,"context_line":"        self._registry_notify(resources.SECURITY_GROUP, events.BEFORE_DELETE,"},{"line_number":280,"context_line":"                              conv_ept\u003dext_sg.SecurityGroupInUse, **kwargs)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":283,"context_line":"            self._registry_notify(resources.SECURITY_GROUP,"}],"source_content_type":"text/x-python","patch_set":19,"id":"9a68dd71_8f5edd43","line":280,"updated":"2016-01-27 08:13:29.000000000","message":"forgot to pass id?","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5bb76119529452af63f1f11d85516a82664017fc","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        # from being processed. This is a hook point for backend\u0027s validation;"},{"line_number":278,"context_line":"        # we raise to propagate the reason for the failure."},{"line_number":279,"context_line":"        self._registry_notify(resources.SECURITY_GROUP, events.BEFORE_DELETE,"},{"line_number":280,"context_line":"                              conv_ept\u003dext_sg.SecurityGroupInUse, **kwargs)"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":283,"context_line":"            self._registry_notify(resources.SECURITY_GROUP,"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_c95f3574","line":280,"in_reply_to":"9a68dd71_8f5edd43","updated":"2016-01-27 10:12:45.000000000","message":"thanks! amazing accurate.","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"3dd1364a81dfebf951184670cc77011b155acf4d","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        # we raise to propagate the reason for the failure."},{"line_number":628,"context_line":"        self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":629,"context_line":"                              events.BEFORE_DELETE,"},{"line_number":630,"context_line":"                              conv_ept\u003dext_sg.SecurityGroupRuleInUse, **kwargs)"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":633,"context_line":"            query \u003d self._model_query(context, SecurityGroupRule).filter("}],"source_content_type":"text/x-python","patch_set":19,"id":"9a68dd71_2f1b3182","line":630,"updated":"2016-01-27 08:13:29.000000000","message":"ditto","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5bb76119529452af63f1f11d85516a82664017fc","unresolved":false,"context_lines":[{"line_number":627,"context_line":"        # we raise to propagate the reason for the failure."},{"line_number":628,"context_line":"        self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":629,"context_line":"                              events.BEFORE_DELETE,"},{"line_number":630,"context_line":"                              conv_ept\u003dext_sg.SecurityGroupRuleInUse, **kwargs)"},{"line_number":631,"context_line":""},{"line_number":632,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":633,"context_line":"            query \u003d self._model_query(context, SecurityGroupRule).filter("}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_89593d91","line":630,"in_reply_to":"9a68dd71_2f1b3182","updated":"2016-01-27 10:12:45.000000000","message":"Done","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"3dd1364a81dfebf951184670cc77011b155acf4d","unresolved":false,"context_lines":[{"line_number":635,"context_line":""},{"line_number":636,"context_line":"            self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":637,"context_line":"                              events.PRECOMMIT_DELETE,"},{"line_number":638,"context_line":"                              conv_ept\u003dext_sg.SecurityGroupRuleInUse, **kwargs)"},{"line_number":639,"context_line":""},{"line_number":640,"context_line":"            try:"},{"line_number":641,"context_line":"                # As there is a filter on a primary key it is not possible for"}],"source_content_type":"text/x-python","patch_set":19,"id":"9a68dd71_cf11355f","line":638,"updated":"2016-01-27 08:13:29.000000000","message":"ditto","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"5bb76119529452af63f1f11d85516a82664017fc","unresolved":false,"context_lines":[{"line_number":635,"context_line":""},{"line_number":636,"context_line":"            self._registry_notify(resources.SECURITY_GROUP_RULE,"},{"line_number":637,"context_line":"                              events.PRECOMMIT_DELETE,"},{"line_number":638,"context_line":"                              conv_ept\u003dext_sg.SecurityGroupRuleInUse, **kwargs)"},{"line_number":639,"context_line":""},{"line_number":640,"context_line":"            try:"},{"line_number":641,"context_line":"                # As there is a filter on a primary key it is not possible for"}],"source_content_type":"text/x-python","patch_set":19,"id":"7a5de9d1_a95e7974","line":638,"in_reply_to":"9a68dd71_cf11355f","updated":"2016-01-27 10:12:45.000000000","message":"Done","commit_id":"26c7e5b7372fefda389099ffe5004cd5662489b4"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"166472a73d20be18838a1dd17cc72d99dcb380ec","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            \u0027security_group\u0027: s,"},{"line_number":149,"context_line":"            \u0027is_default\u0027: default_sg,"},{"line_number":150,"context_line":"        }"},{"line_number":151,"context_line":"        # NOTE(armax): a callback exception here will prevent the request"},{"line_number":152,"context_line":"        # from being processed. This is a hook point for backend\u0027s validation;"},{"line_number":153,"context_line":"        # we raise to propagate the reason for the failure."},{"line_number":154,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_23629dd9","line":151,"updated":"2016-01-27 13:02:15.000000000","message":"Could move this comment into a docstring for _registry_notify","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"76c97875b95042edd2105c4337db99335d8e88f4","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            \u0027security_group\u0027: s,"},{"line_number":149,"context_line":"            \u0027is_default\u0027: default_sg,"},{"line_number":150,"context_line":"        }"},{"line_number":151,"context_line":"        # NOTE(armax): a callback exception here will prevent the request"},{"line_number":152,"context_line":"        # from being processed. This is a hook point for backend\u0027s validation;"},{"line_number":153,"context_line":"        # we raise to propagate the reason for the failure."},{"line_number":154,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_40176b51","line":151,"in_reply_to":"7a5de9d1_23629dd9","updated":"2016-01-28 02:42:22.000000000","message":"Done","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":7249,"name":"Ann Taraday","email":"akamyshnikova@mirantis.com","username":"AKamyshnikova"},"change_message_id":"8fc442efb004d9a1d25fc4f7d25c1dd00d292519","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        return self._create_bulk(\u0027security_group\u0027, context,"},{"line_number":128,"context_line":"                                 security_group_rule)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _registry_notify(self, res, event, id\u003dNone, exc_cls\u003dNone, **kwargs):"},{"line_number":131,"context_line":"        # NOTE(armax): a callback exception here will prevent the request"},{"line_number":132,"context_line":"        # from being processed. This is a hook point for backend\u0027s validation;"},{"line_number":133,"context_line":"        # we raise to propagate the reason for the failure."}],"source_content_type":"text/x-python","patch_set":23,"id":"7a5de9d1_e648138d","line":130,"range":{"start_line":130,"start_character":8,"end_line":130,"end_character":24},"updated":"2016-02-02 12:31:30.000000000","message":"What about making this method common? So, to have an ability in future to use it somewhere else as well.","commit_id":"bc0a0e9beee60f2081427e29de233e162f0212d9"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"800be191638f4d08191c082945c782ea714e5683","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        return self._create_bulk(\u0027security_group\u0027, context,"},{"line_number":128,"context_line":"                                 security_group_rule)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def _registry_notify(self, res, event, id\u003dNone, exc_cls\u003dNone, **kwargs):"},{"line_number":131,"context_line":"        # NOTE(armax): a callback exception here will prevent the request"},{"line_number":132,"context_line":"        # from being processed. This is a hook point for backend\u0027s validation;"},{"line_number":133,"context_line":"        # we raise to propagate the reason for the failure."}],"source_content_type":"text/x-python","patch_set":23,"id":"5a5ae5dd_3ac5e55a","line":130,"range":{"start_line":130,"start_character":8,"end_line":130,"end_character":24},"in_reply_to":"7a5de9d1_e648138d","updated":"2016-02-03 03:20:39.000000000","message":"thanks Ann, I can submit another patch to refactor it.","commit_id":"bc0a0e9beee60f2081427e29de233e162f0212d9"}],"neutron/tests/unit/db/test_securitygroups_db.py":[{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"3d1979f164889b986dae36ba019a96f874a69955","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        with mock.patch.object(registry, \"notify\") as mock_notify:"},{"line_number":91,"context_line":"            method \u003d getattr(self.mixin, (\"%s_security_group\" % method))"},{"line_number":92,"context_line":"            method(self.ctx, secgroup)"},{"line_number":93,"context_line":"            mock_notify.assert_has_calls([mock.call(\u0027security_group\u0027,"},{"line_number":94,"context_line":"                \u0027precommit_create\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":95,"context_line":"                is_default\u003dmock.ANY, security_group\u003dmock.ANY)])"},{"line_number":96,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a740942_3281614b","line":93,"updated":"2015-12-04 07:57:02.000000000","message":"not sure if assert_has_calls sufficent...","commit_id":"bf1473ff6666c178f46c8034815af1985dd15c70"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"064785b4d32269b9a2e5dee72716ee28089d6f2a","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                    sg_rule_dict[\u0027id\u0027])"},{"line_number":123,"context_line":"            mock_notify.assert_has_calls([mock.call(\u0027security_group_rule\u0027,"},{"line_number":124,"context_line":"                \u0027precommit_delete\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":125,"context_line":"                security_group_rule_id\u003dmock.ANY)])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_2549e7d0","line":125,"updated":"2015-12-10 18:39:20.000000000","message":"(both of) these looks like 3 tests in one, and it would be better if they were split.","commit_id":"79a922e8766403ddb86b6b897bd6d56f6575e253"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"fd829620d0e5d2ee87896015b2a79d5726c7b094","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                    sg_rule_dict[\u0027id\u0027])"},{"line_number":123,"context_line":"            mock_notify.assert_has_calls([mock.call(\u0027security_group_rule\u0027,"},{"line_number":124,"context_line":"                \u0027precommit_delete\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":125,"context_line":"                security_group_rule_id\u003dmock.ANY)])"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a740942_39782fc4","line":125,"in_reply_to":"7a740942_2549e7d0","updated":"2015-12-10 21:27:57.000000000","message":"Thanks armax, I will update it. I put them together because update/delete depend on create if we don\u0027t add more mock here...","commit_id":"79a922e8766403ddb86b6b897bd6d56f6575e253"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"05e0cb5e8f742003c4146d3e78c43081aff4c91f","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                \u0027precommit_delete\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":150,"context_line":"                security_group_rule_id\u003dmock.ANY)])"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_precommit_abort_when_exception(self):"},{"line_number":153,"context_line":"        registry.subscribe(mock.MagicMock(side_effect\u003dException()),"},{"line_number":154,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_CREATE)"},{"line_number":155,"context_line":"        callback_abort_create \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a710552_b39b0ec9","line":152,"updated":"2015-12-15 13:22:55.000000000","message":"Would this be better placed in the test module for callbacks, checking PRECOMMIT event\u0027s in addition to BEFORE? I think there is an existing test that can be extended.","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77e0881e68a6ad714e150e716deb5cbd77a6fd0b","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                \u0027precommit_delete\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":150,"context_line":"                security_group_rule_id\u003dmock.ANY)])"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_precommit_abort_when_exception(self):"},{"line_number":153,"context_line":"        registry.subscribe(mock.MagicMock(side_effect\u003dException()),"},{"line_number":154,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_CREATE)"},{"line_number":155,"context_line":"        callback_abort_create \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_7625bdc0","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":43},"updated":"2015-12-17 01:12:00.000000000","message":"this test is not necessary at all","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"18ece592fc7e7b823e887fc02c63860c6bbf80c0","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                \u0027precommit_delete\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":150,"context_line":"                security_group_rule_id\u003dmock.ANY)])"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def test_precommit_abort_when_exception(self):"},{"line_number":153,"context_line":"        registry.subscribe(mock.MagicMock(side_effect\u003dException()),"},{"line_number":154,"context_line":"                resources.SECURITY_GROUP, events.PRECOMMIT_CREATE)"},{"line_number":155,"context_line":"        callback_abort_create \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a7e1126_5cae2299","line":152,"range":{"start_line":152,"start_character":8,"end_line":152,"end_character":43},"in_reply_to":"3a7e1126_7625bdc0","updated":"2015-12-18 16:04:40.000000000","message":"will remove it.","commit_id":"b9a25d11cf9e050b9da57c2ac3504d3085cb54ca"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"ed16b273e91ac9394273aee14a745af04db3cc8f","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        super(SecurityGroupDbMixinTestCase, self).setUp()"},{"line_number":48,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":49,"context_line":"        self.mixin \u003d SecurityGroupDbMixinImpl()"},{"line_number":50,"context_line":"        self.sg_dict \u003d self.mixin.create_security_group(self.ctx,"},{"line_number":51,"context_line":"                                                        FAKE_SECGROUP)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def test_create_security_group_conflict(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3a7e1126_bbfb3778","line":50,"updated":"2015-12-21 20:58:26.000000000","message":"why do you create this object member only to use it twice? It seems counterintuitive.","commit_id":"795a1e325a1736b4deb16852b5a9f0bc5487fb05"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"a306fa4b3a2bab4ab0a3a30bbbee59ee81b328ab","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        super(SecurityGroupDbMixinTestCase, self).setUp()"},{"line_number":48,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":49,"context_line":"        self.mixin \u003d SecurityGroupDbMixinImpl()"},{"line_number":50,"context_line":"        self.sg_dict \u003d self.mixin.create_security_group(self.ctx,"},{"line_number":51,"context_line":"                                                        FAKE_SECGROUP)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def test_create_security_group_conflict(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a7b0d38_b541c93b","line":50,"in_reply_to":"1a7b0d38_6a4b922c","updated":"2015-12-23 05:28:34.000000000","message":"Done","commit_id":"795a1e325a1736b4deb16852b5a9f0bc5487fb05"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"02ebe53a1a08101e6b24be448e5fae597b52c63a","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        super(SecurityGroupDbMixinTestCase, self).setUp()"},{"line_number":48,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":49,"context_line":"        self.mixin \u003d SecurityGroupDbMixinImpl()"},{"line_number":50,"context_line":"        self.sg_dict \u003d self.mixin.create_security_group(self.ctx,"},{"line_number":51,"context_line":"                                                        FAKE_SECGROUP)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def test_create_security_group_conflict(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a7b0d38_6a4b922c","line":50,"in_reply_to":"3a7e1126_bbfb3778","updated":"2015-12-22 18:11:14.000000000","message":"Looks like it should be used in the other two tests.","commit_id":"795a1e325a1736b4deb16852b5a9f0bc5487fb05"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"a306fa4b3a2bab4ab0a3a30bbbee59ee81b328ab","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        super(SecurityGroupDbMixinTestCase, self).setUp()"},{"line_number":48,"context_line":"        self.ctx \u003d context.get_admin_context()"},{"line_number":49,"context_line":"        self.mixin \u003d SecurityGroupDbMixinImpl()"},{"line_number":50,"context_line":"        self.sg_dict \u003d self.mixin.create_security_group(self.ctx,"},{"line_number":51,"context_line":"                                                        FAKE_SECGROUP)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def test_create_security_group_conflict(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a7b0d38_155c5d24","line":50,"in_reply_to":"3a7e1126_bbfb3778","updated":"2015-12-23 05:28:34.000000000","message":"Thanks I will fix it.","commit_id":"795a1e325a1736b4deb16852b5a9f0bc5487fb05"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"471904ead21708b1d0f65b6f99b76c0b44f19509","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                    sg_rule_dict[\u0027id\u0027])"},{"line_number":144,"context_line":"            mock_notify.assert_has_calls([mock.call(\u0027security_group_rule\u0027,"},{"line_number":145,"context_line":"                \u0027precommit_delete\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":146,"context_line":"                security_group_rule_id\u003dmock.ANY)])"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa69d971_e016a2f0","line":146,"updated":"2016-01-08 00:38:16.000000000","message":"One of the important parts of precommit is ensuring that it\u0027s actually part of the transaction. Please add tests that result in an exception during notificaiton to ensure that the transaction does get rolled back.","commit_id":"700764238a9612e0cc78dcc20a0a72cb0d659740"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"2a30525127e90b659d08dab28a438dc2304613d4","unresolved":false,"context_lines":[{"line_number":143,"context_line":"                    sg_rule_dict[\u0027id\u0027])"},{"line_number":144,"context_line":"            mock_notify.assert_has_calls([mock.call(\u0027security_group_rule\u0027,"},{"line_number":145,"context_line":"                \u0027precommit_delete\u0027, mock.ANY, context\u003dmock.ANY,"},{"line_number":146,"context_line":"                security_group_rule_id\u003dmock.ANY)])"}],"source_content_type":"text/x-python","patch_set":12,"id":"fa69d971_32262dbb","line":146,"in_reply_to":"fa69d971_e016a2f0","updated":"2016-01-08 08:02:59.000000000","message":"thanks, will update these cases.","commit_id":"700764238a9612e0cc78dcc20a0a72cb0d659740"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"de1c406f00d6f62392f976bf12887080e381341b","unresolved":false,"context_lines":[{"line_number":102,"context_line":"            securitygroup.SecurityGroupRuleNotFound):"},{"line_number":103,"context_line":"            self.mixin.delete_security_group_rule(self.ctx, \u0027foo_rule\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def test_security_group_precommit_create_event(self):"},{"line_number":106,"context_line":"        registry.subscribe(fake_callback, resources.SECURITY_GROUP,"},{"line_number":107,"context_line":"                           events.PRECOMMIT_CREATE)"},{"line_number":108,"context_line":"        with mock.patch.object(sqlalchemy.orm.session.SessionTransaction,"}],"source_content_type":"text/x-python","patch_set":14,"id":"da6ed579_016a90b3","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":50},"updated":"2016-01-13 16:50:05.000000000","message":"if I look between this patchset and the last one I looked at, it seems now you\u0027re only testing the failure path, and we lost the happy path, didn\u0027t we?\n\nShould we test the happy path too?","commit_id":"c9eef36ea60e2c9c316e41bd9831d230cebc0238"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"166472a73d20be18838a1dd17cc72d99dcb380ec","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                              self.ctx, sg_dict[\u0027id\u0027])"},{"line_number":135,"context_line":"            self.assertTrue(mock_rollback.called)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def test_security_group_rule_precommit_create_event_fail(self):"},{"line_number":138,"context_line":"        registry.subscribe(fake_callback, resources.SECURITY_GROUP_RULE,"},{"line_number":139,"context_line":"                           events.PRECOMMIT_CREATE)"},{"line_number":140,"context_line":"        sg_dict \u003d self.mixin.create_security_group(self.ctx, FAKE_SECGROUP)"}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_03d8c152","line":137,"updated":"2016-01-27 13:02:15.000000000","message":"nit: Would be nice to group all the security group rule tests together.","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"76c97875b95042edd2105c4337db99335d8e88f4","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                              self.ctx, sg_dict[\u0027id\u0027])"},{"line_number":135,"context_line":"            self.assertTrue(mock_rollback.called)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def test_security_group_rule_precommit_create_event_fail(self):"},{"line_number":138,"context_line":"        registry.subscribe(fake_callback, resources.SECURITY_GROUP_RULE,"},{"line_number":139,"context_line":"                           events.PRECOMMIT_CREATE)"},{"line_number":140,"context_line":"        sg_dict \u003d self.mixin.create_security_group(self.ctx, FAKE_SECGROUP)"}],"source_content_type":"text/x-python","patch_set":20,"id":"7a5de9d1_3bece4c6","line":137,"in_reply_to":"7a5de9d1_03d8c152","updated":"2016-01-28 02:42:22.000000000","message":"Done","commit_id":"9a0df0e7f20276007d9d8dc7e9bfd61239550730"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"0f0352a295af0bd6a563b7657ab281bb81ec94c8","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                           events.PRECOMMIT_UPDATE)"},{"line_number":118,"context_line":"        sg_dict \u003d self.mixin.create_security_group(self.ctx, FAKE_SECGROUP)"},{"line_number":119,"context_line":"        with mock.patch.object(sqlalchemy.orm.session.SessionTransaction,"},{"line_number":120,"context_line":"                              \u0027rollback\u0027) as mock_rollback:"},{"line_number":121,"context_line":"            self.assertRaises(securitygroup.SecurityGroupConflict,"},{"line_number":122,"context_line":"                              self.mixin.update_security_group,"},{"line_number":123,"context_line":"                              self.ctx, sg_dict[\u0027id\u0027], FAKE_SECGROUP)"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a5ae5dd_73af03e4","line":120,"updated":"2016-02-03 08:08:14.000000000","message":"isn\u0027t it safer to make this mock call the original method?\notherwise this might confuse sqlalchemy about its state.","commit_id":"27f0c8f2358ff003dfa934c69d6674cc8cf0644a"},{"author":{"_account_id":11114,"name":"yalei wang","email":"yalei.wang@intel.com","username":"yalie"},"change_message_id":"2cbd086bdbd38c461cd2049519af38b008e51111","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                           events.PRECOMMIT_UPDATE)"},{"line_number":118,"context_line":"        sg_dict \u003d self.mixin.create_security_group(self.ctx, FAKE_SECGROUP)"},{"line_number":119,"context_line":"        with mock.patch.object(sqlalchemy.orm.session.SessionTransaction,"},{"line_number":120,"context_line":"                              \u0027rollback\u0027) as mock_rollback:"},{"line_number":121,"context_line":"            self.assertRaises(securitygroup.SecurityGroupConflict,"},{"line_number":122,"context_line":"                              self.mixin.update_security_group,"},{"line_number":123,"context_line":"                              self.ctx, sg_dict[\u0027id\u0027], FAKE_SECGROUP)"}],"source_content_type":"text/x-python","patch_set":24,"id":"5a5ae5dd_fcbadf6d","line":120,"in_reply_to":"5a5ae5dd_73af03e4","updated":"2016-02-03 10:04:24.000000000","message":"thanks, but it has been mocked to check called, how to run it?","commit_id":"27f0c8f2358ff003dfa934c69d6674cc8cf0644a"}]}
