)]}'
{"nova/compute/resource_tracker.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0218e55214db61b563c11a81050523c63f25b101","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                  \u0027used_disk\u0027: resources[\u0027local_gb_used\u0027],"},{"line_number":550,"context_line":"                  \u0027total_vcpus\u0027: tcpu,"},{"line_number":551,"context_line":"                  \u0027used_vcpus\u0027: ucpu,"},{"line_number":552,"context_line":"                  \u0027pci_stats\u0027: pci_device_pools})"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"    def _resource_change(self, resources):"},{"line_number":555,"context_line":"        \"\"\"Check to see if any resouces have changed.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6ced46_921b5dc9","line":552,"updated":"2015-03-25 16:19:18.000000000","message":"you could have changed the key but that\u0027s fine","commit_id":"b39ad71bc6018597eac2d5063108fd9126eb7341"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d54e26603e311a9768c1e1b73e1664c7ba969ca2","unresolved":false,"context_lines":[{"line_number":549,"context_line":"                  \u0027used_disk\u0027: resources[\u0027local_gb_used\u0027],"},{"line_number":550,"context_line":"                  \u0027total_vcpus\u0027: tcpu,"},{"line_number":551,"context_line":"                  \u0027used_vcpus\u0027: ucpu,"},{"line_number":552,"context_line":"                  \u0027pci_stats\u0027: pci_device_pools})"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"    def _resource_change(self, resources):"},{"line_number":555,"context_line":"        \"\"\"Check to see if any resouces have changed.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6ced46_0568041c","line":552,"in_reply_to":"1a6ced46_921b5dc9","updated":"2015-03-25 16:53:41.000000000","message":"Trying to avoid breaking things for string freeze.","commit_id":"b39ad71bc6018597eac2d5063108fd9126eb7341"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2177fd26354c88027d32547ede8b6cde71760276","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        for k, v in updates.items():"},{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027:"},{"line_number":57,"context_line":"                compute_node.pci_device_pools \u003d \\"},{"line_number":58,"context_line":"                        objects.PciDevicePool.from_dict(v)"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                setattr(compute_node, k, v)"},{"line_number":61,"context_line":"        compute_node.save()"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a6ced46_12ea400f","line":58,"updated":"2015-03-24 14:47:37.000000000","message":"that won\u0027t work, pci_device_pools is a list of PCIDevicePool object, so you should iterate that way :\n\ncn_pci_device_pools \u003d [ objects.PciDevicePool.from_dict(pool) for pool in v]","commit_id":"ca4808ea6159f1c8915b06a936de3688efd0edeb"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2177fd26354c88027d32547ede8b6cde71760276","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027:"},{"line_number":57,"context_line":"                compute_node.pci_device_pools \u003d \\"},{"line_number":58,"context_line":"                        objects.PciDevicePool.from_dict(v)"},{"line_number":59,"context_line":"            else:"},{"line_number":60,"context_line":"                setattr(compute_node, k, v)"},{"line_number":61,"context_line":"        compute_node.save()"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1a6ced46_924b902a","line":59,"updated":"2015-03-24 14:47:37.000000000","message":"Also, I think we should provide that helper in the ComputeNode object like _from_primitive(dict)","commit_id":"ca4808ea6159f1c8915b06a936de3688efd0edeb"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"3f7fbf444b0558dcbe0b35b59b92c5d2f1616453","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                           id\u003dcompute_node_id)"},{"line_number":54,"context_line":"        compute_node.obj_reset_changes()"},{"line_number":55,"context_line":"        for k, v in updates.items():"},{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027:"},{"line_number":57,"context_line":"                compute_node.pci_device_pools \u003d objects.PciDevicePoolList("},{"line_number":58,"context_line":"                    objects\u003d[objects.PciDevicePool.from_dict(x)"},{"line_number":59,"context_line":"                             for x in v])"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6ced46_662ad97f","line":56,"updated":"2015-03-24 15:00:07.000000000","message":"this should be \"if k \u003d\u003d \u0027pci_stats\u0027\"?","commit_id":"5bcdef26e8119a50f9cb3093d8445cae7d60b6b9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c08231d0cba4f7e82974dd27579d0c881e99149","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            compute_node_id \u003d stats[\u0027id\u0027]"},{"line_number":41,"context_line":"            updates \u003d stats.copy()"},{"line_number":42,"context_line":"            del updates[\u0027id\u0027]"},{"line_number":43,"context_line":"        else:"},{"line_number":44,"context_line":"            raise exception.ComputeHostNotCreated(name\u003dstr(name))"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        if \u0027stats\u0027 in updates:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_b0b07f8c","line":43,"updated":"2015-03-24 16:52:56.000000000","message":"Eww, can name be unicode?  If so, we should change this at some point to use six.text_type.","commit_id":"77087cb1b101fcd57539fd5bd8277ddbfee8a58e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5f262f3417a3eb1a85782275f30fb8dc731ed50f","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                           id\u003dcompute_node_id)"},{"line_number":54,"context_line":"        compute_node.obj_reset_changes()"},{"line_number":55,"context_line":"        for k, v in updates.items():"},{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027:"},{"line_number":57,"context_line":"                compute_node.pci_device_pools \u003d objects.PciDevicePoolList("},{"line_number":58,"context_line":"                    objects\u003d[objects.PciDevicePool(**x) for x in v])"},{"line_number":59,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a6ced46_708447d4","line":56,"updated":"2015-03-24 16:49:39.000000000","message":"Could maybe use a comment here why we need to check for this and do it explicitly, for those of us not inclined to the scheduler or pci thingies.","commit_id":"77087cb1b101fcd57539fd5bd8277ddbfee8a58e"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"187644f873711cbc63ed13ea88cf4202c8ae3b49","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                           id\u003dcompute_node_id)"},{"line_number":54,"context_line":"        compute_node.obj_reset_changes()"},{"line_number":55,"context_line":"        for k, v in updates.items():"},{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027 and v:"},{"line_number":57,"context_line":"                # NOTE(danms): Since the updates are actually the result of"},{"line_number":58,"context_line":"                # a obj_to_primitive() on some real objects, we need to convert"},{"line_number":59,"context_line":"                # back to a real object (not from_dict() or _from_db_object(),"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6ced46_b5ef7a86","line":56,"updated":"2015-03-25 04:51:17.000000000","message":"there isn\u0027t pci_device_pools\u0027 in updates. The key is pci_stats. or I really misunderstand something?","commit_id":"7bce7c6388b8b9d6a71f94daf72cbb36e42d5637"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4db5c1920d719408148d366288f12dfa7f5e54b1","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                           id\u003dcompute_node_id)"},{"line_number":54,"context_line":"        compute_node.obj_reset_changes()"},{"line_number":55,"context_line":"        for k, v in updates.items():"},{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027 and v:"},{"line_number":57,"context_line":"                # NOTE(danms): Since the updates are actually the result of"},{"line_number":58,"context_line":"                # a obj_to_primitive() on some real objects, we need to convert"},{"line_number":59,"context_line":"                # back to a real object (not from_dict() or _from_db_object(),"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6ced46_fb8481d5","line":56,"in_reply_to":"1a6ced46_b5ef7a86","updated":"2015-03-25 05:22:41.000000000","message":"ok, I know what happend.\n\nThere are some inconsistent.\n\nIn the RT.update_available_resource, the pci device pools store in \u0027pci_stats\u0027 at\nhttps://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L743\n\nIn the RT.instance_claim, the use the ComputeNode obj. So there is pci_device_pools.\n\nWe should change this https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L743 to use \u0027pci_device_pools\u0027 as key. Otherwise the update_availble_resource never can be update device into the ComputeNode.pci_device_pools.","commit_id":"7bce7c6388b8b9d6a71f94daf72cbb36e42d5637"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c9b79e12148b1bd9d9e86250a2a40bbc45c9c76e","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                           id\u003dcompute_node_id)"},{"line_number":54,"context_line":"        compute_node.obj_reset_changes()"},{"line_number":55,"context_line":"        for k, v in updates.items():"},{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027 and v:"},{"line_number":57,"context_line":"                # NOTE(danms): Since the updates are actually the result of"},{"line_number":58,"context_line":"                # a obj_to_primitive() on some real objects, we need to convert"},{"line_number":59,"context_line":"                # back to a real object (not from_dict() or _from_db_object(),"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6ced46_36c3868a","line":56,"in_reply_to":"1a6ced46_fb8481d5","updated":"2015-03-25 11:24:07.000000000","message":"The more I think, the more I hate those kind of hackings we do.\n\nDan, what do you think if we would just replace https://github.com/openstack/nova/blob/master/nova/compute/resource_tracker.py#L448 by a new helper method which would be not a remotable method (so no version bumps) in ComputeNode doing the reverse logic of _from_db_object() ?\n\nThat way, we could then call here in the scheduler client ComputeNode._from_db_object() and prevent any hacking.","commit_id":"7bce7c6388b8b9d6a71f94daf72cbb36e42d5637"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f50f11a0df8031571488a0b7c287d3ef6acde262","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                                           id\u003dcompute_node_id)"},{"line_number":54,"context_line":"        compute_node.obj_reset_changes()"},{"line_number":55,"context_line":"        for k, v in updates.items():"},{"line_number":56,"context_line":"            if k \u003d\u003d \u0027pci_device_pools\u0027 and v:"},{"line_number":57,"context_line":"                # NOTE(danms): Since the updates are actually the result of"},{"line_number":58,"context_line":"                # a obj_to_primitive() on some real objects, we need to convert"},{"line_number":59,"context_line":"                # back to a real object (not from_dict() or _from_db_object(),"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6ced46_16220a52","line":56,"in_reply_to":"1a6ced46_fb8481d5","updated":"2015-03-25 11:28:00.000000000","message":"Yes it seem you are right the pci_device_pools  and will be different from the pci_stats with this solution the pci_device_pools,. I guess it  should be created according to the pci stats","commit_id":"7bce7c6388b8b9d6a71f94daf72cbb36e42d5637"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4db5c1920d719408148d366288f12dfa7f5e54b1","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                # reconstruction. When we start getting a ComputeNode from"},{"line_number":62,"context_line":"                # scheduler this \"bandage\" can go away."},{"line_number":63,"context_line":"                compute_node.pci_device_pools \u003d objects.PciDevicePoolList("},{"line_number":64,"context_line":"                    objects\u003d[objects.PciDevicePool(**x) for x in v])"},{"line_number":65,"context_line":"            else:"},{"line_number":66,"context_line":"                setattr(compute_node, k, v)"},{"line_number":67,"context_line":"        compute_node.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6ced46_1b887de6","line":64,"updated":"2015-03-25 05:22:41.000000000","message":"There should be objects.PciDevicePool(x), otherwise there will get error:\n\n\n2015-03-24 22:27:01.209 TRACE nova.openstack.common.threadgroup     objects\u003d[objects.PciDevicePool(**x) for x in v])\n2015-03-24 22:27:01.209 TRACE nova.openstack.common.threadgroup TypeError: NovaObjectMetaclass object argument after ** must be a mapping, not str","commit_id":"7bce7c6388b8b9d6a71f94daf72cbb36e42d5637"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"d28d7c7d8e4703938ae4902dd145d74b46aef439","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                # reconstruction. When we start getting a ComputeNode from"},{"line_number":62,"context_line":"                # scheduler this \"bandage\" can go away."},{"line_number":63,"context_line":"                compute_node.pci_device_pools \u003d objects.PciDevicePoolList("},{"line_number":64,"context_line":"                    objects\u003d[objects.PciDevicePool(**x) for x in v])"},{"line_number":65,"context_line":"            else:"},{"line_number":66,"context_line":"                setattr(compute_node, k, v)"},{"line_number":67,"context_line":"        compute_node.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6ced46_4ff22ad3","line":64,"in_reply_to":"1a6ced46_1b887de6","updated":"2015-03-25 10:37:42.000000000","message":"oops, more trap. The \u0027v\u0027 can be string or PciDevicePoolList obj","commit_id":"7bce7c6388b8b9d6a71f94daf72cbb36e42d5637"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"f50f11a0df8031571488a0b7c287d3ef6acde262","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                # reconstruction. When we start getting a ComputeNode from"},{"line_number":62,"context_line":"                # scheduler this \"bandage\" can go away."},{"line_number":63,"context_line":"                compute_node.pci_device_pools \u003d objects.PciDevicePoolList("},{"line_number":64,"context_line":"                    objects\u003d[objects.PciDevicePool(**x) for x in v])"},{"line_number":65,"context_line":"            else:"},{"line_number":66,"context_line":"                setattr(compute_node, k, v)"},{"line_number":67,"context_line":"        compute_node.save()"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6ced46_76fedeaf","line":64,"in_reply_to":"1a6ced46_4ff22ad3","updated":"2015-03-25 11:28:00.000000000","message":"v will be dict like this this  {\u0027count\u0027: 7, \u0027vendor_id\u0027: u\u002715b3\u0027, \u0027product_id\u0027: u\u00271004\u0027, \u0027tags\u0027: {u\u0027numa_node\u0027: None, u\u0027physical_network\u0027: u\u0027physnet1\u0027}\nhow it can be string?","commit_id":"7bce7c6388b8b9d6a71f94daf72cbb36e42d5637"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0218e55214db61b563c11a81050523c63f25b101","unresolved":false,"context_lines":[{"line_number":61,"context_line":"                # reconstruction. When we start getting a ComputeNode from"},{"line_number":62,"context_line":"                # scheduler this \"bandage\" can go away."},{"line_number":63,"context_line":"                if v:"},{"line_number":64,"context_line":"                    devpools \u003d [objects.PciDevicePool(**x) for x in v]"},{"line_number":65,"context_line":"                else:"},{"line_number":66,"context_line":"                    devpools \u003d []"},{"line_number":67,"context_line":"                compute_node.pci_device_pools \u003d objects.PciDevicePoolList("}],"source_content_type":"text/x-python","patch_set":8,"id":"1a6ced46_864cffc9","line":64,"updated":"2015-03-25 16:19:18.000000000","message":"I think something is wrong, because IIRC, you got a PCIDeviceStats object which is not having a tags key :\n\nhttps://github.com/openstack/nova/blob/master/nova/pci/stats.py#L240-L246\n\nyou should rather call .from_dict() instead","commit_id":"b39ad71bc6018597eac2d5063108fd9126eb7341"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"5394a4584cb045375aa0c06d658cf8a5ac3c5d61","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                # back to a real object (not from_dict() or _from_db_object(),"},{"line_number":60,"context_line":"                # which expect a db-formatted object) but just an attr-based"},{"line_number":61,"context_line":"                # reconstruction. When we start getting a ComputeNode from"},{"line_number":62,"context_line":"                # scheduler this \"bandage\" can go away."},{"line_number":63,"context_line":"                if v:"},{"line_number":64,"context_line":"                    devpools \u003d [objects.PciDevicePool.from_dict(x) for x in v]"},{"line_number":65,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6ced46_11291d8a","line":62,"updated":"2015-03-25 19:55:43.000000000","message":"What do you mean by \"when we start getting a ComputeNode from scheduler\"? Do you mean \"when we start sending a ComputeNode object to the scheduler as opposed to saving this directly in the database via the conductor RPC API\"?","commit_id":"5b77c108f14f2bcd42fecfcd060331e57a2e07dd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b7f5bed1ee59aa5d26602284917cf6e68bb53dc0","unresolved":false,"context_lines":[{"line_number":59,"context_line":"                # back to a real object (not from_dict() or _from_db_object(),"},{"line_number":60,"context_line":"                # which expect a db-formatted object) but just an attr-based"},{"line_number":61,"context_line":"                # reconstruction. When we start getting a ComputeNode from"},{"line_number":62,"context_line":"                # scheduler this \"bandage\" can go away."},{"line_number":63,"context_line":"                if v:"},{"line_number":64,"context_line":"                    devpools \u003d [objects.PciDevicePool.from_dict(x) for x in v]"},{"line_number":65,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6ced46_675c53ee","line":62,"in_reply_to":"1a6ced46_11291d8a","updated":"2015-03-25 20:52:04.000000000","message":"What I mean is, currently the RT is getting a ComputeNode object, then dictifying it, and then passing it (updated) to us. This code here is just the scheduler RPC client code, so it runs on the RT side of the bus. Presumably we\u0027ll either be passing a ComputeNode object directly into this client function at some point (when RT stops dictifying its internals) or something more abstract anyway.\n\nRight now, it\u0027s passing a dict representation of the object into here, which we\u0027re trying to recreate as an object so we can call .save() on it. This comment kinda goes with the one a few lines above where we receive a very odd combination of internals from RT.","commit_id":"5b77c108f14f2bcd42fecfcd060331e57a2e07dd"}]}
