)]}'
{"nova/objects/pci_device.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"69f480f17de471e297b021be855de94728efe4be","unresolved":false,"context_lines":[{"line_number":243,"context_line":"        devices in a list. It is intentionally not a .save() on a PciDeviceList"},{"line_number":244,"context_line":"        object because we don\u0027t want to make it look like you can alter a"},{"line_number":245,"context_line":"        result set from a DB query and have the save operation make the DB look"},{"line_number":246,"context_line":"        like the list."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        for device in devices:"},{"line_number":249,"context_line":"            if not isinstance(device, PciDevice):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_ef72db10","line":246,"updated":"2015-08-11 10:18:56.000000000","message":"TBH I don\u0027t really understand the reasoning behind this. If we establish that a save() on a ListObject class does a batch save like described here, then I believe people writing the code would not make assumptions about how save() works on the DB level. Actually objects really don\u0027t give you any choice but to figure out what is happening in every method as there is at this point enough edge cases that you can\u0027t really make assumptions.","commit_id":"0da6264e9d34c4cb7112f790ec542fdc1a1e1c65"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"77f664e267455f66f2365c9cfeb6357a93f922fa","unresolved":false,"context_lines":[{"line_number":243,"context_line":"        devices in a list. It is intentionally not a .save() on a PciDeviceList"},{"line_number":244,"context_line":"        object because we don\u0027t want to make it look like you can alter a"},{"line_number":245,"context_line":"        result set from a DB query and have the save operation make the DB look"},{"line_number":246,"context_line":"        like the list."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        for device in devices:"},{"line_number":249,"context_line":"            if not isinstance(device, PciDevice):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_40610704","line":246,"in_reply_to":"1a4dcd0f_ef72db10","updated":"2015-08-12 18:54:06.000000000","message":"Every other save() method on DB-backed objects that I\u0027m aware of refreshes the state of the object as part of the call. If there are examples that don\u0027t then I\u0027d argue they\u0027re bugs.\n\nThat\u0027s a pretty consistent story right now and even though we can\u0027t be 100% consistent, I still think it helps.","commit_id":"0da6264e9d34c4cb7112f790ec542fdc1a1e1c65"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"af912a826cbf9de7a9e4c52b934a467e146cccc3","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        like the list."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        for device in devices:"},{"line_number":249,"context_line":"            if not isinstance(device, PciDevice):"},{"line_number":250,"context_line":"                raise ovo_exc.ObjectActionError("},{"line_number":251,"context_line":"                    action\u003d\u0027save_batch\u0027,"},{"line_number":252,"context_line":"                    reason\u003d\u0027All devices must be PciDevice\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_ee5af8f1","line":249,"updated":"2015-08-10 21:13:54.000000000","message":"Will this ever happen? isn\u0027t this something that would be caught at the field level?\n\nIf it can happen, then you should add a unit test for it to make sure this gets raised :)","commit_id":"0da6264e9d34c4cb7112f790ec542fdc1a1e1c65"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"276cb47d166be15d73a30482c6791ff5938cfc68","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        like the list."},{"line_number":247,"context_line":"        \"\"\""},{"line_number":248,"context_line":"        for device in devices:"},{"line_number":249,"context_line":"            if not isinstance(device, PciDevice):"},{"line_number":250,"context_line":"                raise ovo_exc.ObjectActionError("},{"line_number":251,"context_line":"                    action\u003d\u0027save_batch\u0027,"},{"line_number":252,"context_line":"                    reason\u003d\u0027All devices must be PciDevice\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_711569e3","line":249,"in_reply_to":"1a4dcd0f_ee5af8f1","updated":"2015-08-10 21:42:38.000000000","message":"I don\u0027t want people passing other object types to this to get them to batch save. This is a classmethod, so you can pass whatever you want in for devices, so it could be abused.\n\nAnd yes, it should have a test :)","commit_id":"0da6264e9d34c4cb7112f790ec542fdc1a1e1c65"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"f153c17b01017b020e2b9e7a733f6d09a09b84cf","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                raise ovo_exc.ObjectActionError("},{"line_number":251,"context_line":"                    action\u003d\u0027save_batch\u0027,"},{"line_number":252,"context_line":"                    reason\u003d\u0027All devices must be PciDevice\u0027)"},{"line_number":253,"context_line":"            with device.obj_alternate_context(context):"},{"line_number":254,"context_line":"                device.save()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a122d0e_2b73f616","line":253,"updated":"2016-05-03 13:07:52.000000000","message":"does\u0027t re-using the same context this way somehow make this all into a single DB transaction somehow? As I kinda assume the transaction wouldn\u0027t leak out the facade","commit_id":"0a220d855446cf6e96021b5835d246e172fc0e1f"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"439971895a832c57c66261e978011b5e86e9729d","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                raise ovo_exc.ObjectActionError("},{"line_number":251,"context_line":"                    action\u003d\u0027save_batch\u0027,"},{"line_number":252,"context_line":"                    reason\u003d\u0027All devices must be PciDevice\u0027)"},{"line_number":253,"context_line":"            with device.obj_alternate_context(context):"},{"line_number":254,"context_line":"                device.save()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a122d0e_6f1fb170","line":253,"in_reply_to":"1a122d0e_2654cd1f","updated":"2016-05-03 16:20:01.000000000","message":"right, that makes sense. like we have done for the api_db stuff I guess.","commit_id":"0a220d855446cf6e96021b5835d246e172fc0e1f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9532be501a056d2752c4e1522b5676637e888a24","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                raise ovo_exc.ObjectActionError("},{"line_number":251,"context_line":"                    action\u003d\u0027save_batch\u0027,"},{"line_number":252,"context_line":"                    reason\u003d\u0027All devices must be PciDevice\u0027)"},{"line_number":253,"context_line":"            with device.obj_alternate_context(context):"},{"line_number":254,"context_line":"                device.save()"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a122d0e_2654cd1f","line":253,"in_reply_to":"1a122d0e_2b73f616","updated":"2016-05-03 13:30:42.000000000","message":"I don\u0027t think it will in this case because we do the transaction at the sqlapi layer for conventional stuff. If we moved the use of main_context_manager.writer into here like we have elsewhere, then it would be one transaction.","commit_id":"0a220d855446cf6e96021b5835d246e172fc0e1f"}]}
