)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"2ab84e3181fb1d816977e83b5c428518aad0fe7b","unresolved":false,"context_lines":[{"line_number":3501,"context_line":"            block_device_info \u003d self._get_instance_block_device_info("},{"line_number":3502,"context_line":"                    context, instance, refresh_conn_info\u003dTrue)"},{"line_number":3503,"context_line":""},{"line_number":3504,"context_line":"            if instance.migration_context:"},{"line_number":3505,"context_line":"                # NOTE(lbeliveau): Swap old and new devices so that neutron"},{"line_number":3506,"context_line":"                # api can update the ports back to the original devices."},{"line_number":3507,"context_line":"                (instance.migration_context.old_pci_devices,"},{"line_number":3508,"context_line":"                 instance.migration_context.new_pci_devices) \u003d \\"},{"line_number":3509,"context_line":"                    (instance.migration_context.new_pci_devices,"},{"line_number":3510,"context_line":"                     instance.migration_context.old_pci_devices)"},{"line_number":3511,"context_line":"                instance.save()"},{"line_number":3512,"context_line":""},{"line_number":3513,"context_line":"            # NOTE(lbeliveau): migrate_instance_finish() need to be executed"},{"line_number":3514,"context_line":"            # before spawning the guest so that the neutron ports are updated."}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_fef6b8f7","line":3511,"range":{"start_line":3504,"start_character":0,"end_line":3511,"end_character":31},"updated":"2016-06-07 02:51:18.000000000","message":"I think you have other good options like\n1) move the Lines 3504-3510 to before Line 3491 to reduce the\nextra save call.\n2) you have the migration in https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1566\nand is status should be \u0027reverted\u0027 https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L3445\nso you can add to _update_port_binding_for_instance flag that if you are reverted and if so just the old pci device\n\nalso I don\u0027t believe the jay will like extra db call here :)","commit_id":"b7b5dfaaff9583e0712cc275190ee8a5ffdf398a"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"736a357f7f67b59da1cbf19e610866bacd767415","unresolved":false,"context_lines":[{"line_number":3501,"context_line":"            block_device_info \u003d self._get_instance_block_device_info("},{"line_number":3502,"context_line":"                    context, instance, refresh_conn_info\u003dTrue)"},{"line_number":3503,"context_line":""},{"line_number":3504,"context_line":"            if instance.migration_context:"},{"line_number":3505,"context_line":"                # NOTE(lbeliveau): Swap old and new devices so that neutron"},{"line_number":3506,"context_line":"                # api can update the ports back to the original devices."},{"line_number":3507,"context_line":"                (instance.migration_context.old_pci_devices,"},{"line_number":3508,"context_line":"                 instance.migration_context.new_pci_devices) \u003d \\"},{"line_number":3509,"context_line":"                    (instance.migration_context.new_pci_devices,"},{"line_number":3510,"context_line":"                     instance.migration_context.old_pci_devices)"},{"line_number":3511,"context_line":"                instance.save()"},{"line_number":3512,"context_line":""},{"line_number":3513,"context_line":"            # NOTE(lbeliveau): migrate_instance_finish() need to be executed"},{"line_number":3514,"context_line":"            # before spawning the guest so that the neutron ports are updated."}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_c454a522","line":3511,"range":{"start_line":3504,"start_character":0,"end_line":3511,"end_character":31},"in_reply_to":"7aa08908_fef6b8f7","updated":"2016-06-07 14:55:39.000000000","message":"Done","commit_id":"b7b5dfaaff9583e0712cc275190ee8a5ffdf398a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"297ee2b94a678becb731b07e5495e23b1bf1dea1","unresolved":false,"context_lines":[{"line_number":3507,"context_line":"            rt \u003d self._get_resource_tracker(instance.node)"},{"line_number":3508,"context_line":"            rt.revert_move_claim(context, instance)"},{"line_number":3509,"context_line":""},{"line_number":3510,"context_line":"            instance.save()"},{"line_number":3511,"context_line":""},{"line_number":3512,"context_line":"            self.compute_rpcapi.finish_revert_resize(context, instance,"},{"line_number":3513,"context_line":"                    migration, migration.source_compute,"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_99105503","line":3510,"range":{"start_line":3510,"start_character":12,"end_line":3510,"end_character":27},"updated":"2016-07-05 16:30:42.000000000","message":"Why isn\u0027t this called as part of \u0027revert_move_claim\u0027?","commit_id":"2b285818536a6ca60a467c1baa6c15d9ae80ab3a"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"d4e1ca5c9d9a03093a0687bf6c22b5f20d2cae84","unresolved":false,"context_lines":[{"line_number":3507,"context_line":"            rt \u003d self._get_resource_tracker(instance.node)"},{"line_number":3508,"context_line":"            rt.revert_move_claim(context, instance)"},{"line_number":3509,"context_line":""},{"line_number":3510,"context_line":"            instance.save()"},{"line_number":3511,"context_line":""},{"line_number":3512,"context_line":"            self.compute_rpcapi.finish_revert_resize(context, instance,"},{"line_number":3513,"context_line":"                    migration, migration.source_compute,"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_2d2f5bf7","line":3510,"range":{"start_line":3510,"start_character":12,"end_line":3510,"end_character":27},"in_reply_to":"1aa78d24_99105503","updated":"2016-07-05 17:51:19.000000000","message":"I guess it could be done there as well.  But I think this is more in line and consistent with other steps/methods in this file (see prep_resize, finish_resize, etc.).","commit_id":"2b285818536a6ca60a467c1baa6c15d9ae80ab3a"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"77ca9ae8c8979e6b1240e4eb106687d6869b7ebc","unresolved":false,"context_lines":[{"line_number":3503,"context_line":"            with migration.obj_as_admin():"},{"line_number":3504,"context_line":"                migration.save()"},{"line_number":3505,"context_line":""},{"line_number":3506,"context_line":"            # NOTE(lbeliveau): This is executed on the destination node and"},{"line_number":3507,"context_line":"            # it\u0027s important on revert that the \u0027new\u0027 PCI devices be freed."},{"line_number":3508,"context_line":"            # Can\u0027t use update_available_resource() here because even"},{"line_number":3509,"context_line":"            # if the instance is destroyed, it still show up as an"}],"source_content_type":"text/x-python","patch_set":25,"id":"dada55a8_7bfe0baf","line":3506,"updated":"2016-07-20 15:44:42.000000000","message":"s/NOTE(...)//","commit_id":"e43a496fa1624153809efe203e9eafefe536f6ac"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"77ca9ae8c8979e6b1240e4eb106687d6869b7ebc","unresolved":false,"context_lines":[{"line_number":3567,"context_line":"            block_device_info \u003d self._get_instance_block_device_info("},{"line_number":3568,"context_line":"                    context, instance, refresh_conn_info\u003dTrue)"},{"line_number":3569,"context_line":""},{"line_number":3570,"context_line":"            # NOTE(lbeliveau): migrate_instance_finish() need to be executed"},{"line_number":3571,"context_line":"            # before spawning the guest so that the neutron ports are updated."},{"line_number":3572,"context_line":"            # Also, refresh nw_info so that the driver uses the latest ports"},{"line_number":3573,"context_line":"            # information."}],"source_content_type":"text/x-python","patch_set":25,"id":"dada55a8_1b0d4fe8","line":3570,"updated":"2016-07-20 15:44:42.000000000","message":"s/NOTE(...)//","commit_id":"e43a496fa1624153809efe203e9eafefe536f6ac"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ed93c9ff239d06dea1b54849228a542b7f75fbd0","unresolved":false,"context_lines":[{"line_number":3567,"context_line":"            block_device_info \u003d self._get_instance_block_device_info("},{"line_number":3568,"context_line":"                    context, instance, refresh_conn_info\u003dTrue)"},{"line_number":3569,"context_line":""},{"line_number":3570,"context_line":"            # NOTE(lbeliveau): migrate_instance_finish() need to be executed"},{"line_number":3571,"context_line":"            # before spawning the guest so that the neutron ports are updated."},{"line_number":3572,"context_line":"            # Also, refresh nw_info so that the driver uses the latest ports"},{"line_number":3573,"context_line":"            # information."}],"source_content_type":"text/x-python","patch_set":25,"id":"dada55a8_c0b497f3","line":3570,"updated":"2016-07-25 18:08:44.000000000","message":"s/need to be/needs to be/","commit_id":"e43a496fa1624153809efe203e9eafefe536f6ac"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ed93c9ff239d06dea1b54849228a542b7f75fbd0","unresolved":false,"context_lines":[{"line_number":3576,"context_line":"                                                     instance,"},{"line_number":3577,"context_line":"                                                     migration_p)"},{"line_number":3578,"context_line":"            network_info \u003d self.network_api.get_instance_nw_info(context,"},{"line_number":3579,"context_line":"                                                                 instance)"},{"line_number":3580,"context_line":""},{"line_number":3581,"context_line":"            rt \u003d self._get_resource_tracker(instance.node)"},{"line_number":3582,"context_line":"            rt.drop_move_claim(context, instance)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dada55a8_a0b7e3f3","line":3579,"updated":"2016-07-25 18:08:44.000000000","message":"So, if the above succeeds and the below drop_move_claim() fails, then we will have out-of-sync Neutron port information, right? We\u0027ve just moved the raciness from after to before the drop_move_claim() but not actually addressed the root cause of the raciness, which is that we have no call to revert the networking update when something fails in drop_move_claim()...","commit_id":"e43a496fa1624153809efe203e9eafefe536f6ac"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ed93c9ff239d06dea1b54849228a542b7f75fbd0","unresolved":false,"context_lines":[{"line_number":362,"context_line":"                    pci_devices \u003d self._get_migration_context_resource("},{"line_number":363,"context_line":"                        \u0027pci_devices\u0027, instance, prefix\u003dprefix)"},{"line_number":364,"context_line":"                    if pci_devices:"},{"line_number":365,"context_line":"                        for pci_device in pci_devices:"},{"line_number":366,"context_line":"                            self.pci_tracker.free_device(pci_device, instance)"},{"line_number":367,"context_line":""},{"line_number":368,"context_line":"                self._update_usage(usage, sign\u003d-1)"}],"source_content_type":"text/x-python","patch_set":25,"id":"dada55a8_00cfcf7f","line":365,"updated":"2016-07-25 18:08:44.000000000","message":"It seems to me that you could have just had the above in this patch and put the code that moved where migrate_instance_finish() was called in a totally separate patch (since, I\u0027m actually not convinced that change fixes anything fully)...","commit_id":"e43a496fa1624153809efe203e9eafefe536f6ac"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"77ca9ae8c8979e6b1240e4eb106687d6869b7ebc","unresolved":false,"context_lines":[{"line_number":382,"context_line":"            for dev in migration_context.new_pci_devices:"},{"line_number":383,"context_line":"                self.pci_tracker.free_device(dev, instance)"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"        # NOTE(lbeliveau): It\u0027s important to call _update() which will save"},{"line_number":386,"context_line":"        # the PCI devices.  Else we get in a racy condition where instances"},{"line_number":387,"context_line":"        # can hold stale PCI devices."},{"line_number":388,"context_line":"        ctxt \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":25,"id":"dada55a8_dbbbb7e3","line":385,"updated":"2016-07-20 15:44:42.000000000","message":"s/NOTE(...)//","commit_id":"e43a496fa1624153809efe203e9eafefe536f6ac"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"44b1bf2def69fe5e81f67ff413510e041337a5c2","unresolved":false,"context_lines":[{"line_number":1874,"context_line":"                migration_context.new_pci_devices):"},{"line_number":1875,"context_line":"            # NOTE(lbeliveau): In case of revert, swap old and new devices to"},{"line_number":1876,"context_line":"            # update the ports back to the original devices."},{"line_number":1877,"context_line":"            if migration and migration.get(\u0027status\u0027, \u0027\u0027) \u003d\u003d \u0027reverted\u0027:"},{"line_number":1878,"context_line":"                (migration_context.old_pci_devices,"},{"line_number":1879,"context_line":"                 migration_context.new_pci_devices) \u003d \\"},{"line_number":1880,"context_line":"                    (migration_context.new_pci_devices,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_9ed02df8","line":1877,"range":{"start_line":1877,"start_character":39,"end_line":1877,"end_character":56},"updated":"2016-06-07 14:59:16.000000000","message":"I think you can just get(\u0027status\u0027)","commit_id":"f40d8f821319de6a98bd7ac4aa70eb9c5c05ee48"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"d05028ac4fa2041d8cddaa356a9420a5a945942c","unresolved":false,"context_lines":[{"line_number":1874,"context_line":"                migration_context.new_pci_devices):"},{"line_number":1875,"context_line":"            # NOTE(lbeliveau): In case of revert, swap old and new devices to"},{"line_number":1876,"context_line":"            # update the ports back to the original devices."},{"line_number":1877,"context_line":"            if migration and migration.get(\u0027status\u0027, \u0027\u0027) \u003d\u003d \u0027reverted\u0027:"},{"line_number":1878,"context_line":"                (migration_context.old_pci_devices,"},{"line_number":1879,"context_line":"                 migration_context.new_pci_devices) \u003d \\"},{"line_number":1880,"context_line":"                    (migration_context.new_pci_devices,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7aa08908_453389ab","line":1877,"range":{"start_line":1877,"start_character":39,"end_line":1877,"end_character":56},"in_reply_to":"7aa08908_9ed02df8","updated":"2016-06-07 16:41:45.000000000","message":"Done","commit_id":"f40d8f821319de6a98bd7ac4aa70eb9c5c05ee48"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"60fc32e64d7d54efc4ca8841b56107c2482a0e48","unresolved":false,"context_lines":[{"line_number":2143,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":2144,"context_line":"        pass"},{"line_number":2145,"context_line":""},{"line_number":2146,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance, migration):"},{"line_number":2147,"context_line":"        \"\"\"Get the mapping between the old PCI devices and the new PCI"},{"line_number":2148,"context_line":"        devices that have been allocated during this migration.  The"},{"line_number":2149,"context_line":"        correlation is based on PCI request ID which is unique per PCI"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_1c7ff817","line":2146,"updated":"2016-07-12 11:59:50.000000000","message":"An other solution would be to have two methods to make the code with less conditions.\n\n   def _get_pci_mapping_for_migration(self, context, instance)\n     ...\n   def _get_reverted_pci_mapping_for_migration(self, context, instance):\n     self._get_pci_mapping_for_migration(..)\n     ...\n\n   def _update_port_binding_for_instance(self, ...):\n      revert \u003d migration.get(\u0027status\u0027) \u003d\u003d \u0027revert\u0027\n      pci_mapping \u003d (not revert self._get_pci_mapping_for_migration() else \n                                      self._get_reverted_pci_mapping_for_migration())\n      ...\n\nThe point is just to have the code simple to understand, I\u0027m little bit worry about that method \u0027_get_pci_mapping_for_migration\u0027 which inverse the result in different cases.","commit_id":"14a9dba7fe66de3b9a55cceb2ec0daf1b0a4ce54"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"9feacd1c2961ec2ec673b300622127605547796b","unresolved":false,"context_lines":[{"line_number":2143,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":2144,"context_line":"        pass"},{"line_number":2145,"context_line":""},{"line_number":2146,"context_line":"    def _get_pci_mapping_for_migration(self, context, instance, migration):"},{"line_number":2147,"context_line":"        \"\"\"Get the mapping between the old PCI devices and the new PCI"},{"line_number":2148,"context_line":"        devices that have been allocated during this migration.  The"},{"line_number":2149,"context_line":"        correlation is based on PCI request ID which is unique per PCI"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_4fe79146","line":2146,"in_reply_to":"1aa78d24_1c7ff817","updated":"2016-07-14 13:30:18.000000000","message":"so I have just passed a flag if we wanted the original or revered result","commit_id":"14a9dba7fe66de3b9a55cceb2ec0daf1b0a4ce54"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"60fc32e64d7d54efc4ca8841b56107c2482a0e48","unresolved":false,"context_lines":[{"line_number":2164,"context_line":"                      {\u0027old\u0027: [dev for dev in old_pci_devices],"},{"line_number":2165,"context_line":"                      \u0027new\u0027: [dev for dev in new_pci_devices]})"},{"line_number":2166,"context_line":""},{"line_number":2167,"context_line":"            # NOTE(lbeliveau): In case of revert, swap old and new devices to"},{"line_number":2168,"context_line":"            # update the ports back to the original devices."},{"line_number":2169,"context_line":"            if migration and migration.get(\u0027status\u0027) \u003d\u003d \u0027reverted\u0027:"},{"line_number":2170,"context_line":"                (old_pci_devices, new_pci_devices) \u003d \\"}],"source_content_type":"text/x-python","patch_set":22,"id":"1aa78d24_be04dc7d","line":2167,"updated":"2016-07-12 11:59:50.000000000","message":"s/NOTE(lbeliveau):// \n\nThis change can also directly be done 2159","commit_id":"14a9dba7fe66de3b9a55cceb2ec0daf1b0a4ce54"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"489c6fc5fbdb4d42b97f839ab65d82395db511ef","unresolved":false,"context_lines":[{"line_number":2158,"context_line":"        \"\"\"Cleanup network for specified instance on host.\"\"\""},{"line_number":2159,"context_line":"        pass"},{"line_number":2160,"context_line":""},{"line_number":2161,"context_line":"    def _get_pci_devices_from_migration_context(self, migration_context,"},{"line_number":2162,"context_line":"                                                migration):"},{"line_number":2163,"context_line":"        if migration and migration.get(\u0027status\u0027) \u003d\u003d \u0027reverted\u0027:"},{"line_number":2164,"context_line":"            # In case of revert, swap old and new devices to"}],"source_content_type":"text/x-python","patch_set":24,"id":"dada55a8_b99bb9c8","line":2161,"updated":"2016-07-19 11:55:44.000000000","message":"Yes I guess it\u0027s something we can do. I still find that a little bit difficult to apprehend but I don\"t really have better to purpose.","commit_id":"786622af07c2393b663c0bee153db906aeb33fbe"}],"nova/pci/manager.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"297ee2b94a678becb731b07e5495e23b1bf1dea1","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        if sign \u003d\u003d 1:"},{"line_number":310,"context_line":"            self.allocate_instance(instance)"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    # TODO(lbeliveau): It\u0027s possible that when an instance is reverting that"},{"line_number":313,"context_line":"    # the compute manager periodic task kicks in and that it tries to clean"},{"line_number":314,"context_line":"    # up an instance that is migrating or reverting.  The resource tracker"},{"line_number":315,"context_line":"    # doesn\u0027t see it as an active instance in this case.  This cause the PCI"},{"line_number":316,"context_line":"    # devices to be freed even if the migration is not confirmed or finished"},{"line_number":317,"context_line":"    # reverted.  To remove when the resource tracker and pci tracker are"},{"line_number":318,"context_line":"    # less racy."},{"line_number":319,"context_line":"    def _is_instance_migrating(self, context, uuid):"},{"line_number":320,"context_line":"        try:"},{"line_number":321,"context_line":"            instance \u003d objects.Instance.get_by_uuid(context, uuid)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_d973fd7e","line":318,"range":{"start_line":312,"start_character":0,"end_line":318,"end_character":16},"updated":"2016-07-05 16:30:42.000000000","message":"Is it worth opening a bug against this?","commit_id":"2b285818536a6ca60a467c1baa6c15d9ae80ab3a"},{"author":{"_account_id":17973,"name":"Ludovic Beliveau","email":"lbeliveau@gmail.com","username":"lbeliveau"},"change_message_id":"d4e1ca5c9d9a03093a0687bf6c22b5f20d2cae84","unresolved":false,"context_lines":[{"line_number":309,"context_line":"        if sign \u003d\u003d 1:"},{"line_number":310,"context_line":"            self.allocate_instance(instance)"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    # TODO(lbeliveau): It\u0027s possible that when an instance is reverting that"},{"line_number":313,"context_line":"    # the compute manager periodic task kicks in and that it tries to clean"},{"line_number":314,"context_line":"    # up an instance that is migrating or reverting.  The resource tracker"},{"line_number":315,"context_line":"    # doesn\u0027t see it as an active instance in this case.  This cause the PCI"},{"line_number":316,"context_line":"    # devices to be freed even if the migration is not confirmed or finished"},{"line_number":317,"context_line":"    # reverted.  To remove when the resource tracker and pci tracker are"},{"line_number":318,"context_line":"    # less racy."},{"line_number":319,"context_line":"    def _is_instance_migrating(self, context, uuid):"},{"line_number":320,"context_line":"        try:"},{"line_number":321,"context_line":"            instance \u003d objects.Instance.get_by_uuid(context, uuid)"}],"source_content_type":"text/x-python","patch_set":18,"id":"1aa78d24_2d7d9be7","line":318,"range":{"start_line":312,"start_character":0,"end_line":318,"end_character":16},"in_reply_to":"1aa78d24_d973fd7e","updated":"2016-07-05 17:51:19.000000000","message":"Yes, it would make sense.  We are not sure yet if we should split this patch in multiple ones.\n\nI still need to add unit tests for some of the cases ...","commit_id":"2b285818536a6ca60a467c1baa6c15d9ae80ab3a"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"489c6fc5fbdb4d42b97f839ab65d82395db511ef","unresolved":false,"context_lines":[{"line_number":3680,"context_line":"        instance.pci_devices \u003d instance.migration_context.old_pci_devices"},{"line_number":3681,"context_line":""},{"line_number":3682,"context_line":"        pci_mapping \u003d self.api._get_pci_mapping_for_migration("},{"line_number":3683,"context_line":"            self.context, instance, False)"},{"line_number":3684,"context_line":"        self.assertEqual({\u00270000:0a:00.1\u0027: new_pci_devices[0]}, pci_mapping)"},{"line_number":3685,"context_line":""},{"line_number":3686,"context_line":"    def test_get_pci_mapping_for_migration_reverted(self):"}],"source_content_type":"text/x-python","patch_set":24,"id":"dada55a8_59a9dd7a","line":3683,"updated":"2016-07-19 11:55:44.000000000","message":"I don\u0027t see where this method is looking to handle a Boolean, something is not clear on your tests","commit_id":"786622af07c2393b663c0bee153db906aeb33fbe"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"6d79ea38b1cf2632ffae7225f7861e1213c79d3c","unresolved":false,"context_lines":[{"line_number":3680,"context_line":"        instance.pci_devices \u003d instance.migration_context.old_pci_devices"},{"line_number":3681,"context_line":""},{"line_number":3682,"context_line":"        pci_mapping \u003d self.api._get_pci_mapping_for_migration("},{"line_number":3683,"context_line":"            self.context, instance, False)"},{"line_number":3684,"context_line":"        self.assertEqual({\u00270000:0a:00.1\u0027: new_pci_devices[0]}, pci_mapping)"},{"line_number":3685,"context_line":""},{"line_number":3686,"context_line":"    def test_get_pci_mapping_for_migration_reverted(self):"}],"source_content_type":"text/x-python","patch_set":24,"id":"dada55a8_4847441d","line":3683,"in_reply_to":"dada55a8_59a9dd7a","updated":"2016-07-19 13:44:26.000000000","message":"Done","commit_id":"786622af07c2393b663c0bee153db906aeb33fbe"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"489c6fc5fbdb4d42b97f839ab65d82395db511ef","unresolved":false,"context_lines":[{"line_number":3707,"context_line":""},{"line_number":3708,"context_line":"        pci_mapping \u003d self.api._get_pci_mapping_for_migration("},{"line_number":3709,"context_line":"            self.context, instance, migration)"},{"line_number":3710,"context_line":"        self.assertEqual({\u00270000:0b:00.1\u0027: old_pci_devices[0]}, pci_mapping)"},{"line_number":3711,"context_line":""},{"line_number":3712,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3713,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":24,"id":"dada55a8_b9a1f9ab","line":3710,"updated":"2016-07-19 11:55:44.000000000","message":"I don\u0027t understand something, here we call \u0027_get_pci_mapping_for_migration\u0027 which should return a mapping {\u003cold pci address\u003e: \u003cnew pci object\u003e, ...} - So how that can works ?","commit_id":"786622af07c2393b663c0bee153db906aeb33fbe"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"6d79ea38b1cf2632ffae7225f7861e1213c79d3c","unresolved":false,"context_lines":[{"line_number":3707,"context_line":""},{"line_number":3708,"context_line":"        pci_mapping \u003d self.api._get_pci_mapping_for_migration("},{"line_number":3709,"context_line":"            self.context, instance, migration)"},{"line_number":3710,"context_line":"        self.assertEqual({\u00270000:0b:00.1\u0027: old_pci_devices[0]}, pci_mapping)"},{"line_number":3711,"context_line":""},{"line_number":3712,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.compute_utils\u0027)"},{"line_number":3713,"context_line":"    def test_get_preexisting_port_ids(self, mocked_comp_utils):"}],"source_content_type":"text/x-python","patch_set":24,"id":"dada55a8_d788f124","line":3710,"in_reply_to":"dada55a8_b9a1f9ab","updated":"2016-07-19 13:44:26.000000000","message":"So Ludovic change was to add the _get_pci_devices_from_migration_context to do the swapping \nand this method is called by _get_pci_mapping_for_migration. So this why it working. Another approach will be what I did in PS23 using is_reverted parameter passed to the _get_pci_mapping_for_migration.","commit_id":"786622af07c2393b663c0bee153db906aeb33fbe"}]}
