)]}'
{"nova/cells/messaging.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1996f32374062042605f0977bd011c1ebe0133b3","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        for key in items_to_remove:"},{"line_number":1166,"context_line":"            bdm.pop(key, None)"},{"line_number":1167,"context_line":"        if create is None:"},{"line_number":1168,"context_line":"            LOG.debug(\u0027Calling db.block_device_mapping_update_or_create from \u0027"},{"line_number":1169,"context_line":"                      \u0027API cell with values: %s\u0027, bdm)"},{"line_number":1170,"context_line":"            self.db.block_device_mapping_update_or_create(message.ctxt,"},{"line_number":1171,"context_line":"                                                          bdm,"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_12de8f6d","line":1168,"updated":"2015-11-04 14:48:08.000000000","message":"Can we always assume that bdm[\u0027instance_uuid\u0027] is set? If so, that would really help with tracing requests through the code since the request ID changes between n-api and the cells logs.","commit_id":"86fe90f7056432416ea3c2335ea8c2ad6e16b79a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8eddb6d0d8b077c52c0e9760d5ddbd83e8738cbf","unresolved":false,"context_lines":[{"line_number":1165,"context_line":"        for key in items_to_remove:"},{"line_number":1166,"context_line":"            bdm.pop(key, None)"},{"line_number":1167,"context_line":"        if create is None:"},{"line_number":1168,"context_line":"            LOG.debug(\u0027Calling db.block_device_mapping_update_or_create from \u0027"},{"line_number":1169,"context_line":"                      \u0027API cell with values: %s\u0027, bdm)"},{"line_number":1170,"context_line":"            self.db.block_device_mapping_update_or_create(message.ctxt,"},{"line_number":1171,"context_line":"                                                          bdm,"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_8d4d8074","line":1168,"in_reply_to":"fa80f949_12de8f6d","updated":"2015-11-04 15:09:36.000000000","message":"You can get the original req-id using message.ctxt.request_id I guess","commit_id":"86fe90f7056432416ea3c2335ea8c2ad6e16b79a"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"255e3264d5a4a6f36d359541eb13bc7bd7d25597","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"        if create is None:"},{"line_number":1168,"context_line":"            LOG.debug(\u0027Calling db.block_device_mapping_update_or_create from \u0027"},{"line_number":1169,"context_line":"                      \u0027API cell with values: %s\u0027, bdm)"},{"line_number":1170,"context_line":"            self.db.block_device_mapping_update_or_create(message.ctxt,"},{"line_number":1171,"context_line":"                                                          bdm,"},{"line_number":1172,"context_line":"                                                          legacy\u003dFalse)"},{"line_number":1173,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_cc6f2a91","line":1170,"updated":"2015-11-03 21:21:56.000000000","message":"An idea for more detail if needed would be to have this method return an indicator of whether or not it updated or created a bdm.  We could probably get the data from the current return since it\u0027s a sqlalchemy result object but that would be a layer violation.  And logging within the db method may be too verbose though that\u0027s another option.","commit_id":"86fe90f7056432416ea3c2335ea8c2ad6e16b79a"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e7a894c40ee8ab59586af9e108f6f37703a0471d","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"        if create is None:"},{"line_number":1168,"context_line":"            LOG.debug(\u0027Calling db.block_device_mapping_update_or_create from \u0027"},{"line_number":1169,"context_line":"                      \u0027API cell with values: %s\u0027, bdm)"},{"line_number":1170,"context_line":"            self.db.block_device_mapping_update_or_create(message.ctxt,"},{"line_number":1171,"context_line":"                                                          bdm,"},{"line_number":1172,"context_line":"                                                          legacy\u003dFalse)"},{"line_number":1173,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_835f9771","line":1170,"in_reply_to":"fa80f949_71ddb613","updated":"2015-11-04 13:07:14.000000000","message":"I was expecting that there would be a sqlalchemy method that would indicate whether or not a row was added, like the row_count but with more info.  However that does not actually appear to exist from what I can see, so scratch that idea.\n\nI\u0027m not totally clear on why the update is there either.  I thought it was because the bdm can be created early with no device name and then it will be updated later, but that wouldn\u0027t make sense since it keys off of device name.  I do agree that we should have clear points where we create and then everything subsequent would update.","commit_id":"86fe90f7056432416ea3c2335ea8c2ad6e16b79a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"8eddb6d0d8b077c52c0e9760d5ddbd83e8738cbf","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"        if create is None:"},{"line_number":1168,"context_line":"            LOG.debug(\u0027Calling db.block_device_mapping_update_or_create from \u0027"},{"line_number":1169,"context_line":"                      \u0027API cell with values: %s\u0027, bdm)"},{"line_number":1170,"context_line":"            self.db.block_device_mapping_update_or_create(message.ctxt,"},{"line_number":1171,"context_line":"                                                          bdm,"},{"line_number":1172,"context_line":"                                                          legacy\u003dFalse)"},{"line_number":1173,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_ad872460","line":1170,"in_reply_to":"fa80f949_835f9771","updated":"2015-11-04 15:09:36.000000000","message":"I\u0027d tend to change the interface to make explicit calls to either create or update and not hide that behind that API.","commit_id":"86fe90f7056432416ea3c2335ea8c2ad6e16b79a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ad4d3271f52426c3fd99b8700484ac8d6c6bc22a","unresolved":false,"context_lines":[{"line_number":1167,"context_line":"        if create is None:"},{"line_number":1168,"context_line":"            LOG.debug(\u0027Calling db.block_device_mapping_update_or_create from \u0027"},{"line_number":1169,"context_line":"                      \u0027API cell with values: %s\u0027, bdm)"},{"line_number":1170,"context_line":"            self.db.block_device_mapping_update_or_create(message.ctxt,"},{"line_number":1171,"context_line":"                                                          bdm,"},{"line_number":1172,"context_line":"                                                          legacy\u003dFalse)"},{"line_number":1173,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa80f949_71ddb613","line":1170,"in_reply_to":"fa80f949_cc6f2a91","updated":"2015-11-03 22:31:15.000000000","message":"I thought about something like that, I wasn\u0027t sure what would be in the returned sqlalchemy object that would tell us if it was new or not though.\n\nWe could also do some logging in the update_or_create method, but yeah, seems very verbose.\n\nAnother option I was talking about in IRC was in nova.compute.api.API.create_db_entry_for_new_instance if num_instances \u003d\u003d 1, we could pass something to _create_block_device_mapping to tell it if it should call bdm.update_or_create() vs just bdm.create().  I think the update is there for the multiple instance case, but I wasn\u0027t sure.","commit_id":"86fe90f7056432416ea3c2335ea8c2ad6e16b79a"}]}
