)]}'
{"glance/db/__init__.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"79edc1b32449b882b82ce28c60f1af1aac0f5f47","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        try:"},{"line_number":339,"context_line":"            self.db_api.image_update(self.context,"},{"line_number":340,"context_line":"                                     self.image.image_id,"},{"line_number":341,"context_line":"                                     {\"updated_at\": timeutils.utcnow()})"},{"line_number":342,"context_line":"        except (exception.ImageNotFound, exception.Forbidden):"},{"line_number":343,"context_line":"            msg \u003d _(\"No image found with ID %s\") % self.image.image_id"},{"line_number":344,"context_line":"            raise exception.ImageNotFound(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_ca24b2c6","line":341,"updated":"2016-03-09 12:40:49.000000000","message":"Can we find a way to let the database set the date itself? I\u0027d like to avoid generating the time from Glance land","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"763c1241ee26e253fd1fae3232b846bf87df1ec8","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        try:"},{"line_number":339,"context_line":"            self.db_api.image_update(self.context,"},{"line_number":340,"context_line":"                                     self.image.image_id,"},{"line_number":341,"context_line":"                                     {\"updated_at\": timeutils.utcnow()})"},{"line_number":342,"context_line":"        except (exception.ImageNotFound, exception.Forbidden):"},{"line_number":343,"context_line":"            msg \u003d _(\"No image found with ID %s\") % self.image.image_id"},{"line_number":344,"context_line":"            raise exception.ImageNotFound(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_eab1a548","line":341,"in_reply_to":"5aef4532_ca24b2c6","updated":"2016-03-09 14:25:53.000000000","message":"you need to clarify what you mean by \"let the database set the date\".  Right now, the timestamp here originally comes from oslo.db-\u003esqlalchemy-\u003emodels-\u003eTimestampMixin, which uses the timeutils.utcnow() function to generate the \"created_at\" / \"updated_at\" timestamps.  You wouldn\u0027t want to use a DB-side timestamp function here.\n\nif OTOH you\u0027re talking about just bypassing calling the whole top-level API for image_update, then there are a lot of ways to do this depending on what you\u0027re going for.   The simplest would probably be, instead of calling `self._image_timestamp_update()` here, just say, `self.image.updated_at \u003d timeutils.utcnow()`.   You then might need to flush the Session directly here because it seems like all the methods here use their own Session (this is an antipattern that will be resolved when glance updates its enginefacade code to use current APIs).   \n\nI would note that looking at the code here, glance is consistently making use of top-level \"self.db_api.do_a_thing(some_id)\" methods for all data changes, essentially bypassing a lot of what the ORM provides, however this is a common pattern throughout openstack.   So if you want to start diluting that pattern internally, that would be a prominent decision here.","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"1726dd760907397002ffe9a08684918841b9575d","unresolved":false,"context_lines":[{"line_number":338,"context_line":"        try:"},{"line_number":339,"context_line":"            self.db_api.image_update(self.context,"},{"line_number":340,"context_line":"                                     self.image.image_id,"},{"line_number":341,"context_line":"                                     {\"updated_at\": timeutils.utcnow()})"},{"line_number":342,"context_line":"        except (exception.ImageNotFound, exception.Forbidden):"},{"line_number":343,"context_line":"            msg \u003d _(\"No image found with ID %s\") % self.image.image_id"},{"line_number":344,"context_line":"            raise exception.ImageNotFound(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_e9b5bcd0","line":341,"in_reply_to":"5aef4532_eab1a548","updated":"2016-03-15 15:31:52.000000000","message":"If I understand correctly, it looks like what\u0027s being done here is both (a) acceptable, and (b) consistent with current glance practice.  So I guess this is OK.","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"79edc1b32449b882b82ce28c60f1af1aac0f5f47","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                                     {\"updated_at\": timeutils.utcnow()})"},{"line_number":342,"context_line":"        except (exception.ImageNotFound, exception.Forbidden):"},{"line_number":343,"context_line":"            msg \u003d _(\"No image found with ID %s\") % self.image.image_id"},{"line_number":344,"context_line":"            raise exception.ImageNotFound(msg)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    def list(self):"},{"line_number":347,"context_line":"        db_members \u003d self.db_api.image_member_find("}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_857f3d65","line":344,"updated":"2016-03-09 12:40:49.000000000","message":"Would it be confusing for users if we tell them the image was not found when they are updating a supposedly existing image/member ?","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"1726dd760907397002ffe9a08684918841b9575d","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                                     {\"updated_at\": timeutils.utcnow()})"},{"line_number":342,"context_line":"        except (exception.ImageNotFound, exception.Forbidden):"},{"line_number":343,"context_line":"            msg \u003d _(\"No image found with ID %s\") % self.image.image_id"},{"line_number":344,"context_line":"            raise exception.ImageNotFound(msg)"},{"line_number":345,"context_line":""},{"line_number":346,"context_line":"    def list(self):"},{"line_number":347,"context_line":"        db_members \u003d self.db_api.image_member_find("}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_73951b3f","line":344,"in_reply_to":"5aef4532_857f3d65","updated":"2016-03-15 15:31:52.000000000","message":"I think this is OK.  It\u0027s already possible to get an \"image not found\" message when making a member-related call, so this is just protecting from the edge case where an image-delete and a member call are made simultaneously, and the prior member-related stuff has been done without error, but in the meantime the image has been deleted and can\u0027t be found when this timestamp update occurs.","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"79edc1b32449b882b82ce28c60f1af1aac0f5f47","unresolved":false,"context_lines":[{"line_number":403,"context_line":"                                                         image_member_values)"},{"line_number":404,"context_line":"        except (exception.NotFound, exception.Forbidden):"},{"line_number":405,"context_line":"            raise exception.NotFound()"},{"line_number":406,"context_line":"        image_member.updated_at \u003d new_values[\u0027updated_at\u0027]"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def get(self, member_id):"},{"line_number":409,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5aef4532_65015105","line":406,"updated":"2016-03-09 12:40:49.000000000","message":"Should we do that here as well?","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":10063,"name":"Steve McLellan","email":"steven.j.mclellan@gmail.com","username":"sjmc7"},"change_message_id":"fab46138690e33742c5fcb0767f837330742134a","unresolved":false,"context_lines":[{"line_number":403,"context_line":"                                                         image_member_values)"},{"line_number":404,"context_line":"        except (exception.NotFound, exception.Forbidden):"},{"line_number":405,"context_line":"            raise exception.NotFound()"},{"line_number":406,"context_line":"        image_member.updated_at \u003d new_values[\u0027updated_at\u0027]"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def get(self, member_id):"},{"line_number":409,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_90541855","line":406,"in_reply_to":"1af94dfe_0e110ead","updated":"2016-03-15 15:48:48.000000000","message":"Our use case is that we\u0027d like to know when an image logically changes, which i think here would mean the image member approval. A chain of events that would cause us problems is:\n\n* image member is added (updated_at changes)\n* another image change is made - say, a rename (updated_at changes)\n* image member is approved (updated_at does not change)\n\nBecause we rely on updated_at to indicate that there was some kind of state change (which in this case would mean either the rename or that there is a change to the access list) it would be preferable to register that state change timestamp when the member approval happens","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":5314,"name":"Brian Rosmaita","email":"rosmaita.fossdev@gmail.com","username":"brian-rosmaita"},"change_message_id":"1726dd760907397002ffe9a08684918841b9575d","unresolved":false,"context_lines":[{"line_number":403,"context_line":"                                                         image_member_values)"},{"line_number":404,"context_line":"        except (exception.NotFound, exception.Forbidden):"},{"line_number":405,"context_line":"            raise exception.NotFound()"},{"line_number":406,"context_line":"        image_member.updated_at \u003d new_values[\u0027updated_at\u0027]"},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    def get(self, member_id):"},{"line_number":409,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1af94dfe_0e110ead","line":406,"in_reply_to":"5aef4532_65015105","updated":"2016-03-15 15:31:52.000000000","message":"That\u0027s a good question.  This would be a change of state in the member_status, which affects whether or not an image will appear in the user\u0027s default image-list response.  So I guess on the theory that a change in an image\u0027s member-list is really an image update, maybe a change in a member\u0027s status is also an image update?  Though, admittedly, I am not as comfortable with that.  I\u0027ll ping someone from Searchlight (who have an actual use case for this patch) and see what they think.","commit_id":"70607da1c54adf0541e3c01b0b10d8b9617cabdc"},{"author":{"_account_id":2537,"name":"Nikhil Komawar","email":"nik.komawar@gmail.com","username":"nikhil-komawar"},"change_message_id":"2bd6c0f43b87354f9f88f68e0a5483f4c4eee612","unresolved":false,"context_lines":[{"line_number":390,"context_line":"        image_member.updated_at \u003d new_values[\u0027updated_at\u0027]"},{"line_number":391,"context_line":"        image_member.id \u003d new_values[\u0027id\u0027]"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        self._image_timestamp_update()"},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"    def remove(self, image_member):"},{"line_number":396,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a8bc5a2_1663aedd","line":393,"updated":"2016-09-22 16:10:01.000000000","message":"this call looks quite racy to me.\n\nif a user makes 100 calls to add members (which happens to be the case for a real world public cloud), it\u0027s quite possible the earlier addition will be updated last.\n\nAlthough, the difference may be fractional ... hence not sure if it matter significantly. thoughts?\n\nbasically, isn\u0027t there a way we can update these values in the single sqlalchemy session?","commit_id":"c88358ad32b1b5ca48318bfc55878a735e441983"}]}
