)]}'
{"nova/objects/build_request.py":[{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"05234a6c2d43e30af60d94d22b63528a9e524e38","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                continue"},{"line_number":225,"context_line":"            if self.instance.obj_attr_is_set(field):"},{"line_number":226,"context_line":"                setattr(instance, field, getattr(self.instance, field))"},{"line_number":227,"context_line":"        # NOTE(sbauza): We never want to persist the value of the deleted field"},{"line_number":228,"context_line":"        # but only when destroying the instance. We can safely admit that it\u0027s"},{"line_number":229,"context_line":"        # safe to consenquently mark that field as non-dirty now."},{"line_number":230,"context_line":"        instance.obj_reset_changes([\u0027deleted\u0027])"},{"line_number":231,"context_line":"        return instance"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_64fccf72","line":229,"range":{"start_line":227,"start_character":0,"end_line":229,"end_character":65},"updated":"2016-11-25 16:48:20.000000000","message":"this comment is difficult to parse...the language could be clearer.","commit_id":"7b500cb5c02f176422f48709067a71af0fab1072"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c5aee58be6f4fcd5fea98c98de486fb3dd9cd3c8","unresolved":false,"context_lines":[{"line_number":224,"context_line":"                continue"},{"line_number":225,"context_line":"            if self.instance.obj_attr_is_set(field):"},{"line_number":226,"context_line":"                setattr(instance, field, getattr(self.instance, field))"},{"line_number":227,"context_line":"        # NOTE(sbauza): We never want to persist the value of the deleted field"},{"line_number":228,"context_line":"        # but only when destroying the instance. We can safely admit that it\u0027s"},{"line_number":229,"context_line":"        # safe to consenquently mark that field as non-dirty now."},{"line_number":230,"context_line":"        instance.obj_reset_changes([\u0027deleted\u0027])"},{"line_number":231,"context_line":"        return instance"},{"line_number":232,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a74a57a_62c3dfed","line":229,"range":{"start_line":227,"start_character":0,"end_line":229,"end_character":65},"in_reply_to":"5a74a57a_64fccf72","updated":"2016-11-25 17:18:20.000000000","message":"So, lemme explain it a bit more :\n\u0027Deleted\u0027 is a special field for the instance and treated differently from what\u0027s in the DB because the purpose here is to provide to the user whether the instance has been deleted or not.\n\nWe actually never touch the value of that field in the object and we never persist that possible change, because the only time when deleted is modified in the DB is when you actually call the oslo.db helper method called soft_delete() that does take the ID of the object being soft-deleted and replaces the default value of 0 to the ID.\n\nWhen we get the object from the DB and hydrates it, we convert that value into a boolean by just verifying whether the integer value of \u0027deleted\u0027 in DB matches the Instance object ID.","commit_id":"7b500cb5c02f176422f48709067a71af0fab1072"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bfa92971dac53e87f6958c3a1bc488401f2dccf","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            raise exception.BuildRequestNotFound(uuid\u003dself.instance_uuid)"},{"line_number":83,"context_line":"        # NOTE(alaski): Set some fields on instance that are needed by the api,"},{"line_number":84,"context_line":"        # not lazy-loadable, and don\u0027t change."},{"line_number":85,"context_line":"        self.instance.deleted \u003d 0"},{"line_number":86,"context_line":"        self.instance.disable_terminate \u003d False"},{"line_number":87,"context_line":"        self.instance.terminated_at \u003d None"},{"line_number":88,"context_line":"        self.instance.host \u003d None"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a74a57a_5363e441","line":85,"range":{"start_line":85,"start_character":8,"end_line":85,"end_character":33},"updated":"2016-11-28 15:00:20.000000000","message":"As noted in IRC, this is the new thing that causes the bug, we\u0027d never set instance.deleted before calling instance.create() before this.","commit_id":"70ded9917123464eef5031c9eecabd7f3419530e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0286c7ff4f87952d108698d69a2c21dc5ef4d80c","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            # as instance.create() won\u0027t handle it properly."},{"line_number":223,"context_line":"            if field \u003d\u003d \u0027tags\u0027:"},{"line_number":224,"context_line":"                continue"},{"line_number":225,"context_line":"            # NOTE(sbauza): Don\u0027t copy the value of \u0027deleted\u0027 because this"},{"line_number":226,"context_line":"            # field should never be updated elsewhere but by the oslo.db"},{"line_number":227,"context_line":"            # method responsible for soft-deleting"},{"line_number":228,"context_line":"            if field \u003d\u003d \u0027deleted\u0027:"},{"line_number":229,"context_line":"                continue"},{"line_number":230,"context_line":"            if self.instance.obj_attr_is_set(field):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a74a57a_104ec2c0","line":227,"range":{"start_line":225,"start_character":12,"end_line":227,"end_character":50},"updated":"2016-11-28 14:44:42.000000000","message":"If this is the case, how is self.instance.deleted getting set in the first place? If it wasn\u0027t set, the obj_attr_is_set check below would fail and we wouldn\u0027t have this failure.\n\nAnd as noted in the bug report, Instance.deleted is also a boolean, but it must not have been getting set before this, at least on instance create:\n\nhttps://github.com/openstack/nova/blob/520ee65a55bf9894d5915d3cebc892439d703312/nova/objects/base.py#L219","commit_id":"70ded9917123464eef5031c9eecabd7f3419530e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"feb47b8c15d4e6d2609d13def66178726bd508d3","unresolved":false,"context_lines":[{"line_number":222,"context_line":"            # as instance.create() won\u0027t handle it properly."},{"line_number":223,"context_line":"            if field \u003d\u003d \u0027tags\u0027:"},{"line_number":224,"context_line":"                continue"},{"line_number":225,"context_line":"            # NOTE(sbauza): Don\u0027t copy the value of \u0027deleted\u0027 because this"},{"line_number":226,"context_line":"            # field should never be updated elsewhere but by the oslo.db"},{"line_number":227,"context_line":"            # method responsible for soft-deleting"},{"line_number":228,"context_line":"            if field \u003d\u003d \u0027deleted\u0027:"},{"line_number":229,"context_line":"                continue"},{"line_number":230,"context_line":"            if self.instance.obj_attr_is_set(field):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a74a57a_b3cc38bc","line":227,"range":{"start_line":225,"start_character":12,"end_line":227,"end_character":50},"in_reply_to":"5a74a57a_104ec2c0","updated":"2016-11-28 14:51:17.000000000","message":"\u003e\u003e\u003e from nova.objects import instance as instance_obj\n\u003e\u003e\u003e instance \u003d instance_obj.Instance()\n\u003e\u003e\u003e instance.obj_attr_is_set(\u0027deleted\u0027)\nFalse","commit_id":"70ded9917123464eef5031c9eecabd7f3419530e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8422ba58d19af78c1641cc17393483d0a0dce08b","unresolved":false,"context_lines":[{"line_number":225,"context_line":"            # NOTE(sbauza): Don\u0027t copy the value of \u0027deleted\u0027 because this"},{"line_number":226,"context_line":"            # field should never be updated elsewhere but by the oslo.db"},{"line_number":227,"context_line":"            # method responsible for soft-deleting"},{"line_number":228,"context_line":"            if field \u003d\u003d \u0027deleted\u0027:"},{"line_number":229,"context_line":"                continue"},{"line_number":230,"context_line":"            if self.instance.obj_attr_is_set(field):"},{"line_number":231,"context_line":"                setattr(instance, field, getattr(self.instance, field))"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a74a57a_6a1f0408","line":228,"updated":"2016-11-28 13:55:28.000000000","message":"I understand that you want a separate comment for excluding this field, but using multiple \u0027if\u0027 statements like this is very ugly. Instead, put your comment right after the one above, and change this to:\n\n    if field in (\"tags\", \"deleted\"):\n        continue","commit_id":"70ded9917123464eef5031c9eecabd7f3419530e"}]}
