)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"df32a41cd461b66c49d546050807791014ff5b57","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"93b13c18_b4ed3fa7","updated":"2022-06-21 12:19:28.000000000","message":"Thanks sean and melaine for reviews. ","commit_id":"f672de748fb957fd602fb2dd443dff2c18d08d56"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3cb58d2736aea6a88127fd02730bf8bf5128b653","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"0d020702_8119567f","updated":"2022-09-12 12:58:00.000000000","message":"Sorry but I\u0027m a bit afraid of having some bug if we would change this.\nAt least we would need to make sure the tests are working.","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d4b9a683134b377397628b93c44b9a6f4dbe00d3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"2ac568d7_7a87fade","updated":"2022-07-05 10:44:03.000000000","message":"lets wait for others to review before respining this again","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"62e9fdafe7030d2a7e40c57e079d96623248f0cc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"05afeda9_14b92ea0","updated":"2022-06-22 03:51:15.000000000","message":"recheck","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"b02968684888d9d585b94bbbc2360dac0b3a5cf9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"5f1ba5b4_72ca46cc","updated":"2022-06-22 16:08:02.000000000","message":"recheck","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"}],"nova/cmd/manage.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"533f600a447e5203fd6bae0ddd212d7ab578bcda","unresolved":true,"context_lines":[{"line_number":2607,"context_line":"                        consumer_uuid in mig_uuids):"},{"line_number":2608,"context_line":"                    # By default we suspect the orphaned allocation was for a"},{"line_number":2609,"context_line":"                    # migration..."},{"line_number":2610,"context_line":"                    consumer_type \u003d \u0027migration\u0027"},{"line_number":2611,"context_line":"                if consumer_type is not None:"},{"line_number":2612,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2613,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"ea0db919_0d1edb3d","line":2610,"updated":"2022-06-02 12:08:17.000000000","message":"While I agree with the logic in the commit message, I can\u0027t help but think the the intention here was not to just always set it to migration, and that the original implementation made an error in logic. I\u0027m assuming what they wanted to do is more like the following:\n\n  if consumer_uuid not in inst_uuids:\n    consumer_type \u003d \u0027instance\u0027\n  elif consumer_uuid not in mig_uuids:\n    consumer_type \u003d \u0027migration\u0027\n\nIn any case, that consumer_type variable only ends up being used for logging, so I\u0027m wondering if we shouldn\u0027t just delete it entirely, especially considering since we apparently could get it wrong since we apparently just guess?","commit_id":"48c77021973f55069980c4dfd18cba61ec253aad"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"648fad0cf4d54917be6b01ffdbaeced26fe3dcaf","unresolved":false,"context_lines":[{"line_number":2607,"context_line":"                        consumer_uuid in mig_uuids):"},{"line_number":2608,"context_line":"                    # By default we suspect the orphaned allocation was for a"},{"line_number":2609,"context_line":"                    # migration..."},{"line_number":2610,"context_line":"                    consumer_type \u003d \u0027migration\u0027"},{"line_number":2611,"context_line":"                if consumer_type is not None:"},{"line_number":2612,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2613,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"e26f61c2_edeaad9c","line":2610,"in_reply_to":"368e19ab_b53cf0e5","updated":"2022-06-29 21:54:51.000000000","message":"Thanks for updating. I\u0027m going to ping bauzas tomorrow to take a look at this PS. I think he is the best person to confirm the logic here.","commit_id":"48c77021973f55069980c4dfd18cba61ec253aad"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"91207d07e987ffe909f8d4fb5c1d0a304f8bf314","unresolved":true,"context_lines":[{"line_number":2607,"context_line":"                        consumer_uuid in mig_uuids):"},{"line_number":2608,"context_line":"                    # By default we suspect the orphaned allocation was for a"},{"line_number":2609,"context_line":"                    # migration..."},{"line_number":2610,"context_line":"                    consumer_type \u003d \u0027migration\u0027"},{"line_number":2611,"context_line":"                if consumer_type is not None:"},{"line_number":2612,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2613,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"e55e5609_57b1283b","line":2610,"in_reply_to":"599b5273_40d0cece","updated":"2022-06-20 22:40:38.000000000","message":"IMHO I think the likely bug in this is that L2606 intended to say \"if consumer not in inst_uuids or consumer not in mig_uuids, default to type migration\". But it is currently saying \"if consumer not in inst_uuids and consumer not in mig_uuids\" (De Morgan\u0027s Law [1]).\n\nI think this code block is intended to only deal with consumer uuids that are not in the instance or migration lists. It\u0027s trying to guess the consumer type of consumers that are not being tracked as \"active\". If the consumers were in either of those lists, we would already know the consumer type.\n\nSo if we adjust that, the logic is:\n\nIf the consumer is not in the list of non-deleted instances or the consumer is not in the list of in-progress migrations, first assume it is a migration. Then, if the consumer is not in the list of non-deleted instances, assume it is (was) an instance.\n\n if (consumer_uuid not in inst_uuids) or (consumer_uuid not in mig_uuids):\n     consumer_type \u003d \u0027migration\u0027\n     if consumer_uuid not in inst_uuids:\n         consumer_type \u003d \u0027instance\u0027\n     \nI might be confused but I don\u0027t think what\u0027s currently proposed in this patch is equivalent to ^.\n\nEither way, I think it would be a good idea to have bauzas look at this and confirm what he intended the logic to be before changing this.\n\n[1] https://en.wikipedia.org/wiki/De_Morgan%27s_laws","commit_id":"48c77021973f55069980c4dfd18cba61ec253aad"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"0cc4187add765989a5eafbb5263857bf5348689b","unresolved":true,"context_lines":[{"line_number":2607,"context_line":"                        consumer_uuid in mig_uuids):"},{"line_number":2608,"context_line":"                    # By default we suspect the orphaned allocation was for a"},{"line_number":2609,"context_line":"                    # migration..."},{"line_number":2610,"context_line":"                    consumer_type \u003d \u0027migration\u0027"},{"line_number":2611,"context_line":"                if consumer_type is not None:"},{"line_number":2612,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2613,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"599b5273_40d0cece","line":2610,"in_reply_to":"7ccca5f2_45335edd","updated":"2022-06-20 12:49:11.000000000","message":"yes patchset 1 was incorrect patchset 2 is closer but im not sure its correct\ni will need to think about this a little more.\n\n\nfor things like evacute i think we currently just use one allcoation for both the source host and dest host.\n\nfor cold migrate and live migrate i belive we have 2 seperate allcoations in placment.\n\ni dont think this is right\n  if consumer_uuid not in inst_uuids:\n    consumer_type \u003d \u0027instance\u0027\n  elif consumer_uuid not in mig_uuids:\n    consumer_type \u003d \u0027migration\u0027\n    \ni think this is actully what we want including the correct precedence for the condtionals\n\n  if consumer_uuid in mig_uuids:\n    consumer_type \u003d \u0027migration\u0027\n  elif consumer_uuid in inst_uuids:\n    consumer_type \u003d \u0027instance\u0027\n  else:\n   consumer_type \u003d \u0027migration\u0027\n\nand that can be simplifed too\n\nconsumer_type \u003d \u0027migration\u0027\nif consumer_uuid in inst_uuids:\n    consumer_type \u003d \u0027instance\u0027\n\nsince we want to assuem that if we dont have an instance that it maps too this is a leaked allocation from a migration that has already been purged form the db.\n\n\nwe likely should accutly use consumer type unknown for this once we actuly start using consumer types properly since we have other bugs related to this but that is out of scope of this.","commit_id":"48c77021973f55069980c4dfd18cba61ec253aad"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"aaa8dc859a266d0a456c420636eb6d964cc3401c","unresolved":false,"context_lines":[{"line_number":2607,"context_line":"                        consumer_uuid in mig_uuids):"},{"line_number":2608,"context_line":"                    # By default we suspect the orphaned allocation was for a"},{"line_number":2609,"context_line":"                    # migration..."},{"line_number":2610,"context_line":"                    consumer_type \u003d \u0027migration\u0027"},{"line_number":2611,"context_line":"                if consumer_type is not None:"},{"line_number":2612,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2613,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"368e19ab_b53cf0e5","line":2610,"in_reply_to":"cf22abfd_54374097","updated":"2022-06-29 12:48:31.000000000","message":"Done","commit_id":"48c77021973f55069980c4dfd18cba61ec253aad"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"df32a41cd461b66c49d546050807791014ff5b57","unresolved":true,"context_lines":[{"line_number":2607,"context_line":"                        consumer_uuid in mig_uuids):"},{"line_number":2608,"context_line":"                    # By default we suspect the orphaned allocation was for a"},{"line_number":2609,"context_line":"                    # migration..."},{"line_number":2610,"context_line":"                    consumer_type \u003d \u0027migration\u0027"},{"line_number":2611,"context_line":"                if consumer_type is not None:"},{"line_number":2612,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2613,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"cf22abfd_54374097","line":2610,"in_reply_to":"e55e5609_57b1283b","updated":"2022-06-21 12:19:28.000000000","message":"IMHO the above condition is same as:\n```\nif consumer_uuid not in inst_uuids:\n    consumer_type \u003d \u0027migration\u0027\nelif consumer_uuid not in mig_uuid:\n    consumer_type \u003d \u0027instance\u0027\n```    \nSo as per the logic, (copied from above melaine\u0027s comments):\nIf the consumer is not in the list of non-deleted instances or the consumer is not in the list of in-progress migrations, first assume it is a migration. (we can set consumer_type \u003d \u0027migration\u0027 by default). Then, if consumer is not in the list of non-deleted instances, assume it is (was) an instance. (here we can check condition and set it to \u0027instance\u0027).\n\n```\nconsumer_type \u003d \u0027migration\u0027\nif consumer_uuid not in inst_uuids:\n    consumer_type \u003d \u0027instance\u0027\n```    \nThe above condition is modified version of what sean has mentioned in his comments.","commit_id":"48c77021973f55069980c4dfd18cba61ec253aad"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"9afd54193e8f7cbc45d5d8e0df8ecf58b33c54ae","unresolved":true,"context_lines":[{"line_number":2607,"context_line":"                        consumer_uuid in mig_uuids):"},{"line_number":2608,"context_line":"                    # By default we suspect the orphaned allocation was for a"},{"line_number":2609,"context_line":"                    # migration..."},{"line_number":2610,"context_line":"                    consumer_type \u003d \u0027migration\u0027"},{"line_number":2611,"context_line":"                if consumer_type is not None:"},{"line_number":2612,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2613,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"7ccca5f2_45335edd","line":2610,"in_reply_to":"ea0db919_0d1edb3d","updated":"2022-06-20 12:14:49.000000000","message":"it only ends up being used for logging today because consumer types had not landed in placment when this code was written\n\nwe will start usign consume type properly in placement in the future so we need ot make sure this is right because eventually this function shoudl be correecting the new allocation consumer_type in placment too.\n\nhttps://docs.openstack.org/placement/latest/specs/xena/approved/support-consumer-types.html\n\ni have not done a full review of this but i would like to make sure melaine takes a look at this","commit_id":"48c77021973f55069980c4dfd18cba61ec253aad"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"91207d07e987ffe909f8d4fb5c1d0a304f8bf314","unresolved":true,"context_lines":[{"line_number":2500,"context_line":"                cctxt, cn_host, cn_node)"},{"line_number":2501,"context_line":"        mig_uuids \u003d [migration.uuid for migration in migs]"},{"line_number":2502,"context_line":""},{"line_number":2503,"context_line":"        return (inst_uuids, mig_uuids)"},{"line_number":2504,"context_line":""},{"line_number":2505,"context_line":"    def _delete_allocations_from_consumer(self, ctxt, placement, provider,"},{"line_number":2506,"context_line":"                                          consumer_uuid, consumer_type):"}],"source_content_type":"text/x-python","patch_set":2,"id":"2637f476_a16a7277","line":2503,"updated":"2022-06-20 22:40:38.000000000","message":"In this method it\u0027s returning the list of non-deleted instance uuids and the list of in-progress migration uuids.","commit_id":"f672de748fb957fd602fb2dd443dff2c18d08d56"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"aaa8dc859a266d0a456c420636eb6d964cc3401c","unresolved":false,"context_lines":[{"line_number":2500,"context_line":"                cctxt, cn_host, cn_node)"},{"line_number":2501,"context_line":"        mig_uuids \u003d [migration.uuid for migration in migs]"},{"line_number":2502,"context_line":""},{"line_number":2503,"context_line":"        return (inst_uuids, mig_uuids)"},{"line_number":2504,"context_line":""},{"line_number":2505,"context_line":"    def _delete_allocations_from_consumer(self, ctxt, placement, provider,"},{"line_number":2506,"context_line":"                                          consumer_uuid, consumer_type):"}],"source_content_type":"text/x-python","patch_set":2,"id":"b8120ed3_215fde55","line":2503,"in_reply_to":"2637f476_a16a7277","updated":"2022-06-29 12:48:31.000000000","message":"Done","commit_id":"f672de748fb957fd602fb2dd443dff2c18d08d56"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3cb58d2736aea6a88127fd02730bf8bf5128b653","unresolved":true,"context_lines":[{"line_number":2605,"context_line":"                # migration..."},{"line_number":2606,"context_line":"                consumer_type \u003d \u0027migration\u0027"},{"line_number":2607,"context_line":"                if consumer_uuid not in inst_uuids:"},{"line_number":2608,"context_line":"                    consumer_type \u003d \u0027instance\u0027"},{"line_number":2609,"context_line":""},{"line_number":2610,"context_line":"                # The allocation is not orphaned if consumer_uuid is in"},{"line_number":2611,"context_line":"                # inst_uuids or mig_uuids"}],"source_content_type":"text/x-python","patch_set":5,"id":"5eb3dbdf_ec3dd892","line":2608,"updated":"2022-09-12 12:58:00.000000000","message":"this is a very fragile conditional.\n\nIf we can\u0027t find the uuid in the instances, that\u0027s either a migration or a deleted instance, so it shouldn\u0027t be an instance type until we are sure that the instance was removed.","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"849a7256051a149b11b576791c2ef1e81a31abd0","unresolved":true,"context_lines":[{"line_number":2605,"context_line":"                # migration..."},{"line_number":2606,"context_line":"                consumer_type \u003d \u0027migration\u0027"},{"line_number":2607,"context_line":"                if consumer_uuid not in inst_uuids:"},{"line_number":2608,"context_line":"                    consumer_type \u003d \u0027instance\u0027"},{"line_number":2609,"context_line":""},{"line_number":2610,"context_line":"                # The allocation is not orphaned if consumer_uuid is in"},{"line_number":2611,"context_line":"                # inst_uuids or mig_uuids"}],"source_content_type":"text/x-python","patch_set":5,"id":"de2951ec_6599deb6","line":2608,"in_reply_to":"5eb3dbdf_ec3dd892","updated":"2022-09-13 12:57:46.000000000","message":"But here also we are doing same thing, setting consumer_type to instance when uuid is not in instances.\n\nhttps://opendev.org/openstack/nova/src/commit/11cb31258fa5b429ea9881c92b2d745fd127cdaf/nova/cmd/manage.py#L2603-L2606","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3cb58d2736aea6a88127fd02730bf8bf5128b653","unresolved":true,"context_lines":[{"line_number":2610,"context_line":"                # The allocation is not orphaned if consumer_uuid is in"},{"line_number":2611,"context_line":"                # inst_uuids or mig_uuids"},{"line_number":2612,"context_line":"                if consumer_uuid in inst_uuids or consumer_uuid in mig_uuids:"},{"line_number":2613,"context_line":"                    consumer_type \u003d None"},{"line_number":2614,"context_line":""},{"line_number":2615,"context_line":"                if consumer_type is not None:"},{"line_number":2616,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"1d552d55_53e68d20","line":2613,"updated":"2022-09-12 12:58:00.000000000","message":"then, I don\u0027t understand why we should modify the type to be None.\nWhy not by default the type could be None ?","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"849a7256051a149b11b576791c2ef1e81a31abd0","unresolved":true,"context_lines":[{"line_number":2610,"context_line":"                # The allocation is not orphaned if consumer_uuid is in"},{"line_number":2611,"context_line":"                # inst_uuids or mig_uuids"},{"line_number":2612,"context_line":"                if consumer_uuid in inst_uuids or consumer_uuid in mig_uuids:"},{"line_number":2613,"context_line":"                    consumer_type \u003d None"},{"line_number":2614,"context_line":""},{"line_number":2615,"context_line":"                if consumer_type is not None:"},{"line_number":2616,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"734f5a85_449aabb4","line":2613,"in_reply_to":"1d552d55_53e68d20","updated":"2022-09-13 12:57:46.000000000","message":"We assume that orphaned allocation was for migration, so default is set to migration type and we are resetting to None here, if allocation is not orphaned.","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d4b9a683134b377397628b93c44b9a6f4dbe00d3","unresolved":true,"context_lines":[{"line_number":2598,"context_line":"            consumer_allocs \u003d consumer_resources[\u0027resources\u0027]"},{"line_number":2599,"context_line":"            if any(rc in NOVA_RCS"},{"line_number":2600,"context_line":"                   for rc in consumer_allocs):"},{"line_number":2601,"context_line":"                # This is an allocation for Nova resources"},{"line_number":2602,"context_line":"                # We need to guess whether the instance was deleted"},{"line_number":2603,"context_line":"                # or if the instance is currently migrating"},{"line_number":2604,"context_line":"                # By default we suspect the orphaned allocation was for a"},{"line_number":2605,"context_line":"                # migration..."},{"line_number":2606,"context_line":"                consumer_type \u003d \u0027migration\u0027"},{"line_number":2607,"context_line":"                if consumer_uuid not in inst_uuids:"},{"line_number":2608,"context_line":"                    consumer_type \u003d \u0027instance\u0027"},{"line_number":2609,"context_line":""},{"line_number":2610,"context_line":"                # The allocation is not orphaned if consumer_uuid is in"},{"line_number":2611,"context_line":"                # inst_uuids or mig_uuids"},{"line_number":2612,"context_line":"                if consumer_uuid in inst_uuids or consumer_uuid in mig_uuids:"},{"line_number":2613,"context_line":"                    consumer_type \u003d None"},{"line_number":2614,"context_line":""},{"line_number":2615,"context_line":"                if consumer_type is not None:"},{"line_number":2616,"context_line":"                    output(_(\u0027Allocations were set against consumer UUID \u0027"},{"line_number":2617,"context_line":"                             \u0027%(consumer_uuid)s but no existing instances or \u0027"},{"line_number":2618,"context_line":"                             \u0027active migrations are related. \u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"086ecdab_ae3df552","line":2615,"range":{"start_line":2601,"start_character":12,"end_line":2615,"end_character":45},"updated":"2022-07-05 10:44:03.000000000","message":"ok i finally figured out what is bugging me about this code.\nwe are abusing consumer_type\n\nlets remove it entirely \n\nso replace\n\n                # This is an allocation for Nova resources\n                # We need to guess whether the instance was deleted\n                # or if the instance is currently migrating\n                # By default we suspect the orphaned allocation was for a\n                # migration...\n                consumer_type \u003d \u0027migration\u0027\n                if consumer_uuid not in inst_uuids:\n                    consumer_type \u003d \u0027instance\u0027\n                # The allocation is not orphaned if consumer_uuid is in\n                # inst_uuids or mig_uuids\n                if consumer_uuid in inst_uuids or consumer_uuid in mig_uuids:\n                    consumer_type \u003d None\n                if consumer_type is not None:\n\n\nwith\n    \n                if consumer_uuid not in itertools.chain(inst_uuids, mig_uuids):","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"d4b9a683134b377397628b93c44b9a6f4dbe00d3","unresolved":true,"context_lines":[{"line_number":2618,"context_line":"                             \u0027active migrations are related. \u0027)"},{"line_number":2619,"context_line":"                           % {\u0027consumer_uuid\u0027: consumer_uuid})"},{"line_number":2620,"context_line":"                    if delete:"},{"line_number":2621,"context_line":"                        deleted \u003d self._delete_allocations_from_consumer("},{"line_number":2622,"context_line":"                            ctxt, placement, provider, consumer_uuid,"},{"line_number":2623,"context_line":"                            consumer_type)"},{"line_number":2624,"context_line":"                        if not deleted:"},{"line_number":2625,"context_line":"                            print(_(\u0027Not able to delete allocations \u0027"},{"line_number":2626,"context_line":"                                    \u0027for consumer UUID %s\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f068e29_eab5e581","line":2623,"range":{"start_line":2621,"start_character":23,"end_line":2623,"end_character":42},"updated":"2022-07-05 10:44:03.000000000","message":"then here we can replace\n                        deleted \u003d self._delete_allocations_from_consumer(\n                            ctxt, placement, provider, consumer_uuid,\n                            consumer_type)\n                            \nwith\n                        consumer_type \u003d (\n                            \u0027instance\u0027 if consumer_uuid not in inst_uuids\n                            else \u0027migration\u0027\n                        )\n                        deleted \u003d self._delete_allocations_from_consumer(\n                            ctxt, placement, provider, consumer_uuid,\n                            consumer_type)","commit_id":"756c5f2e165bb3ff9df3105610e0615c278cfb5e"}]}
