)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1d260d5a71ac7a4b7f80f198bd863aa9a29a6da0","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Shane Wang \u003cshane.wang@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-01-06 13:51:36 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make id auto-generate in compute node obj create and add more checks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The patch is to remove id when it was set before creating a compute"},{"line_number":10,"context_line":"node in objects, so it can be generated automatically."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAUH%2F%2F8B4%3D","line":7,"updated":"2014-01-06 14:44:59.000000000","message":"I think this is confusing. Something like this would be better:\n\n\"Prevent caller from specifying id during ComputeNode.create()","commit_id":"c2da63ea2482a9dcc4fdbb18195966cc0dcfd587"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"ea692d0c94ef6d3c546dd28c7f40f059cc68e100","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Shane Wang \u003cshane.wang@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2014-01-06 13:51:36 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Make id auto-generate in compute node obj create and add more checks"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The patch is to remove id when it was set before creating a compute"},{"line_number":10,"context_line":"node in objects, so it can be generated automatically."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAUH%2F%2F5NE%3D","line":7,"in_reply_to":"AAAAUH%2F%2F8B4%3D","updated":"2014-01-08 06:35:23.000000000","message":"Done","commit_id":"c2da63ea2482a9dcc4fdbb18195966cc0dcfd587"}],"nova/objects/compute_node.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1d260d5a71ac7a4b7f80f198bd863aa9a29a6da0","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def destroy(self, context):"},{"line_number":86,"context_line":"        if not self.obj_attr_is_set(\u0027id\u0027):"},{"line_number":87,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027destroy\u0027,"},{"line_number":88,"context_line":"                                              reason\u003d\u0027already destroyed\u0027)"},{"line_number":89,"context_line":"        db.compute_node_delete(context, self.id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F8CA%3D","line":88,"updated":"2014-01-06 14:44:59.000000000","message":"I don\u0027t see anywhere that you remove self.id, so I don\u0027t think this will ever get triggered. Even though it\u0027s in a few other places, I think it\u0027s probably reasonable to leave this check out.","commit_id":"c2da63ea2482a9dcc4fdbb18195966cc0dcfd587"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"90a16a9649af3e06833e563e69aeacc93e9b4965","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def destroy(self, context):"},{"line_number":86,"context_line":"        if not self.obj_attr_is_set(\u0027id\u0027):"},{"line_number":87,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027destroy\u0027,"},{"line_number":88,"context_line":"                                              reason\u003d\u0027already destroyed\u0027)"},{"line_number":89,"context_line":"        db.compute_node_delete(context, self.id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2FYjM%3D","line":88,"in_reply_to":"AAAAUH%2F%2F0E8%3D","updated":"2014-01-14 11:30:53.000000000","message":"It is ok to do the check, the problem is that you don\u0027t delete the attribute from the ComputeNode object after deleting the compute node record from the database. So if the destroy is called again the id attribute will still be there. If you look at instance.py you will see it does delattr(self, base.get_attrname(\u0027id\u0027)) at the end of the destroy. \r\n\r\nBut this patch is specifically about the check in the create, which is more important (you can\u0027t delete the same record twice). So I wouldn\u0027t worry abuot this worry about this.","commit_id":"c2da63ea2482a9dcc4fdbb18195966cc0dcfd587"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"ea692d0c94ef6d3c546dd28c7f40f059cc68e100","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def destroy(self, context):"},{"line_number":86,"context_line":"        if not self.obj_attr_is_set(\u0027id\u0027):"},{"line_number":87,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027destroy\u0027,"},{"line_number":88,"context_line":"                                              reason\u003d\u0027already destroyed\u0027)"},{"line_number":89,"context_line":"        db.compute_node_delete(context, self.id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F0E8%3D","line":88,"in_reply_to":"AAAAUH%2F%2F2co%3D","updated":"2014-01-08 06:35:23.000000000","message":"OK, sorry, I didn\u0027t notice that;-)","commit_id":"c2da63ea2482a9dcc4fdbb18195966cc0dcfd587"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"529c490beeb29872e35491860ce72a6dfcf99f39","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def destroy(self, context):"},{"line_number":86,"context_line":"        if not self.obj_attr_is_set(\u0027id\u0027):"},{"line_number":87,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027destroy\u0027,"},{"line_number":88,"context_line":"                                              reason\u003d\u0027already destroyed\u0027)"},{"line_number":89,"context_line":"        db.compute_node_delete(context, self.id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F2co%3D","line":88,"in_reply_to":"AAAAUH%2F%2F53w%3D","updated":"2014-01-07 17:22:43.000000000","message":"In instance the attribute is actually deleted so it works as intended. What you have here does *not* work, right?","commit_id":"c2da63ea2482a9dcc4fdbb18195966cc0dcfd587"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"ec5184603887bc646c25b32c27fe9145968a9250","unresolved":false,"context_lines":[{"line_number":85,"context_line":"    def destroy(self, context):"},{"line_number":86,"context_line":"        if not self.obj_attr_is_set(\u0027id\u0027):"},{"line_number":87,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027destroy\u0027,"},{"line_number":88,"context_line":"                                              reason\u003d\u0027already destroyed\u0027)"},{"line_number":89,"context_line":"        db.compute_node_delete(context, self.id)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAUH%2F%2F53w%3D","line":88,"in_reply_to":"AAAAUH%2F%2F8CA%3D","updated":"2014-01-07 00:48:46.000000000","message":"Dan, do you agree to remove this check out in other places, e.g., instance.py?\n\nThanks.","commit_id":"c2da63ea2482a9dcc4fdbb18195966cc0dcfd587"}],"nova/tests/objects/test_compute_node.py":[{"author":{"_account_id":7641,"name":"Shuangtai Tian","email":"hitianst@gmail.com","username":"shuangtai"},"change_message_id":"adb947e267b8b7b0ed80df7160b1e9262c23a969","unresolved":false,"context_lines":[{"line_number":73,"context_line":"        self.compare_obj(compute, fake_compute_node)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def test_recreate_fails(self):"},{"line_number":76,"context_line":"        self.mox.StubOutWithMock(db, \u0027compute_node_create\u0027)"},{"line_number":77,"context_line":"        db.compute_node_create(self.context, {\u0027service_id\u0027: 456}).AndReturn("},{"line_number":78,"context_line":"            fake_compute_node)"},{"line_number":79,"context_line":"        self.mox.ReplayAll()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2F4oI%3D","line":76,"updated":"2014-01-07 08:40:16.000000000","message":"mock","commit_id":"1f5e23cb4dd062b5e228945ecdeb386741faccc3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"f8f630ef9690fb80e20c2b891317c4691d996142","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        compute.service_id \u003d 456"},{"line_number":82,"context_line":"        compute.create(self.context)"},{"line_number":83,"context_line":"        self.assertRaises(exception.ObjectActionError, compute.create,"},{"line_number":84,"context_line":"                          self.context)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def test_save(self):"},{"line_number":87,"context_line":"        self.mox.StubOutWithMock(db, \u0027compute_node_update\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BJ5Y%3D","line":84,"updated":"2014-01-29 16:34:53.000000000","message":"You don\u0027t set \u0027id\u0027 here, so I don\u0027t see why this should fail as prescribed. What am I missing?","commit_id":"b67f80a292d6641c84ee2959e149f3f05f7014d5"},{"author":{"_account_id":4458,"name":"Shane Wang","email":"shane.wang@intel.com","username":"shane-wang"},"change_message_id":"fde5d2c54e378524f8ab64b2cb166337d4dec19b","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        compute.service_id \u003d 456"},{"line_number":82,"context_line":"        compute.create(self.context)"},{"line_number":83,"context_line":"        self.assertRaises(exception.ObjectActionError, compute.create,"},{"line_number":84,"context_line":"                          self.context)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def test_save(self):"},{"line_number":87,"context_line":"        self.mox.StubOutWithMock(db, \u0027compute_node_update\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9ZEs%3D","line":84,"in_reply_to":"AAAAUH%2F%2BJ5Y%3D","updated":"2014-02-07 08:31:18.000000000","message":"compute.id has already been got by \"compute.create()\" which returns the fake_compute_node. (i.e. compute.id \u003d 123)","commit_id":"b67f80a292d6641c84ee2959e149f3f05f7014d5"}]}
