)]}'
{"nova/objects/pci_device.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"464949fb3aaf251bb9b30014aa8aa11f0a28a569","unresolved":false,"context_lines":[{"line_number":190,"context_line":"    @staticmethod"},{"line_number":191,"context_line":"    def _from_db_object(context, pci_device, db_dev):"},{"line_number":192,"context_line":"        for key in pci_device.fields:"},{"line_number":193,"context_line":"            if key \u003d\u003d \u0027uuid\u0027 and not db_dev.get(key):"},{"line_number":194,"context_line":"                # Older records might not have a uuid field set in the"},{"line_number":195,"context_line":"                # database so we need to skip those here and auto-generate"},{"line_number":196,"context_line":"                # a uuid later below."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_a1be31d2","line":193,"range":{"start_line":193,"start_character":33,"end_line":193,"end_character":52},"updated":"2017-11-29 16:19:27.000000000","message":"This isn\u0027t the same check as would trigger the uuid migration below. If the field was set to an empty string in the DB, we\u0027d not load it here, but then not generate below.\n\nWe\u0027d never get it set, so a .save() would migrate it later if we ever actually called it. However, before we would have caught that situation by trying to load an empty string into a UUIDField, which would throw an exception. Now we will skip the load for that situation, not generate below, and return this object to code that expects uuid to always be set.\n\nNow, I don\u0027t know that we\u0027re able to hit that situation (an empty string) through any normal code paths, but it does seem like asymmetry we should try to avoid for the sake of the dev that has to debug this in the future.\n\ntl;dr: any reason not to actually compare this to None instead of the falsey check?","commit_id":"7cf6948c38744b59e66790f2ef01e221ff9250f1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8871904275d8bcbb29f6cce9575a6e3799d7f3da","unresolved":false,"context_lines":[{"line_number":190,"context_line":"    @staticmethod"},{"line_number":191,"context_line":"    def _from_db_object(context, pci_device, db_dev):"},{"line_number":192,"context_line":"        for key in pci_device.fields:"},{"line_number":193,"context_line":"            if key \u003d\u003d \u0027uuid\u0027 and not db_dev.get(key):"},{"line_number":194,"context_line":"                # Older records might not have a uuid field set in the"},{"line_number":195,"context_line":"                # database so we need to skip those here and auto-generate"},{"line_number":196,"context_line":"                # a uuid later below."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_3cceca59","line":193,"range":{"start_line":193,"start_character":33,"end_line":193,"end_character":52},"in_reply_to":"ff82abbf_3c924a58","updated":"2017-11-29 17:04:49.000000000","message":"I can compare against None. FWIW, I copied this from the Service._from_db_object code so it\u0027s an issue there as well.","commit_id":"7cf6948c38744b59e66790f2ef01e221ff9250f1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a83a7d60a8d8ab513a192f3b027e7c01f309f23a","unresolved":false,"context_lines":[{"line_number":190,"context_line":"    @staticmethod"},{"line_number":191,"context_line":"    def _from_db_object(context, pci_device, db_dev):"},{"line_number":192,"context_line":"        for key in pci_device.fields:"},{"line_number":193,"context_line":"            if key \u003d\u003d \u0027uuid\u0027 and not db_dev.get(key):"},{"line_number":194,"context_line":"                # Older records might not have a uuid field set in the"},{"line_number":195,"context_line":"                # database so we need to skip those here and auto-generate"},{"line_number":196,"context_line":"                # a uuid later below."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_72423911","line":193,"range":{"start_line":193,"start_character":33,"end_line":193,"end_character":52},"in_reply_to":"ff82abbf_3cceca59","updated":"2017-11-29 18:11:40.000000000","message":"Right, but service checks to see if uuid was set on the object for the inline migration, where this code is checking the db_dev itself. So I think that code is fine.","commit_id":"7cf6948c38744b59e66790f2ef01e221ff9250f1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eee8e0adb4fddd2dda6b3e72d12a818d79ce8c4b","unresolved":false,"context_lines":[{"line_number":190,"context_line":"    @staticmethod"},{"line_number":191,"context_line":"    def _from_db_object(context, pci_device, db_dev):"},{"line_number":192,"context_line":"        for key in pci_device.fields:"},{"line_number":193,"context_line":"            if key \u003d\u003d \u0027uuid\u0027 and not db_dev.get(key):"},{"line_number":194,"context_line":"                # Older records might not have a uuid field set in the"},{"line_number":195,"context_line":"                # database so we need to skip those here and auto-generate"},{"line_number":196,"context_line":"                # a uuid later below."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_3c924a58","line":193,"range":{"start_line":193,"start_character":33,"end_line":193,"end_character":52},"in_reply_to":"ff82abbf_81476d77","updated":"2017-11-29 17:00:55.000000000","message":"People do stuff to their DB to try to get past issues like this. If they set them all to non-null, then failed when setting this as a UUID, then looked for a patch and found this, they\u0027d be marching forward with this glazing over the values in the DB and potentially break when they deploy rocky which uses these fields. At that point, they\u0027re far from the original cause of that failure.","commit_id":"7cf6948c38744b59e66790f2ef01e221ff9250f1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"44629d8c7f6afe3fc2f1f3a7b149d1f98b4b3cc7","unresolved":false,"context_lines":[{"line_number":190,"context_line":"    @staticmethod"},{"line_number":191,"context_line":"    def _from_db_object(context, pci_device, db_dev):"},{"line_number":192,"context_line":"        for key in pci_device.fields:"},{"line_number":193,"context_line":"            if key \u003d\u003d \u0027uuid\u0027 and not db_dev.get(key):"},{"line_number":194,"context_line":"                # Older records might not have a uuid field set in the"},{"line_number":195,"context_line":"                # database so we need to skip those here and auto-generate"},{"line_number":196,"context_line":"                # a uuid later below."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_81476d77","line":193,"range":{"start_line":193,"start_character":33,"end_line":193,"end_character":52},"in_reply_to":"ff82abbf_a1be31d2","updated":"2017-11-29 16:38:10.000000000","message":"Ahh, this is true. No one should be setting this to the empty string, but there\u0027s no reason to allow that","commit_id":"7cf6948c38744b59e66790f2ef01e221ff9250f1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"4ecd943071c98cf1bf0c4ff6734e2de32b463f82","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    def _from_db_object(context, pci_device, db_dev):"},{"line_number":192,"context_line":"        for key in pci_device.fields:"},{"line_number":193,"context_line":"            if key \u003d\u003d \u0027uuid\u0027 and not db_dev.get(key):"},{"line_number":194,"context_line":"                # Older records might not have a uuid field set in the"},{"line_number":195,"context_line":"                # database so we need to skip those here and auto-generate"},{"line_number":196,"context_line":"                # a uuid later below."},{"line_number":197,"context_line":"                continue"},{"line_number":198,"context_line":"            elif key !\u003d \u0027extra_info\u0027:"},{"line_number":199,"context_line":"                setattr(pci_device, key, db_dev[key])"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_c66b4b82","line":196,"range":{"start_line":194,"start_character":0,"end_line":196,"end_character":37},"updated":"2017-11-29 15:47:48.000000000","message":"nit: Should we note to remove this in 2.0, as seen below?","commit_id":"7cf6948c38744b59e66790f2ef01e221ff9250f1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"76e79c46ae25bb4fa20d59906ba19d5da90ab9ff","unresolved":false,"context_lines":[{"line_number":191,"context_line":"    def _from_db_object(context, pci_device, db_dev):"},{"line_number":192,"context_line":"        for key in pci_device.fields:"},{"line_number":193,"context_line":"            if key \u003d\u003d \u0027uuid\u0027 and not db_dev.get(key):"},{"line_number":194,"context_line":"                # Older records might not have a uuid field set in the"},{"line_number":195,"context_line":"                # database so we need to skip those here and auto-generate"},{"line_number":196,"context_line":"                # a uuid later below."},{"line_number":197,"context_line":"                continue"},{"line_number":198,"context_line":"            elif key !\u003d \u0027extra_info\u0027:"},{"line_number":199,"context_line":"                setattr(pci_device, key, db_dev[key])"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_26cd5784","line":196,"range":{"start_line":194,"start_character":0,"end_line":196,"end_character":37},"in_reply_to":"ff82abbf_c66b4b82","updated":"2017-11-29 15:51:05.000000000","message":"Meh, no, don\u0027t really care. Since we don\u0027t have any CLI hooks to run the online data migration, I think any talk of a 2.0 object is premature at this point. We also don\u0027t have a db migration blocker script to make you run any of this online before we remove this code, so that would all have to be added first.","commit_id":"7cf6948c38744b59e66790f2ef01e221ff9250f1"}]}
