)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a0277d9c8f9551143237c584737f20e696f8b70f","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix handling of pci_requests in consume_from_instance."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Properly retrieve requests from pci_requests in consume_from_instance."},{"line_number":10,"context_line":"Whithout this the call to numa_fit_instance_to_host will fail because"},{"line_number":11,"context_line":"it expects the request list."},{"line_number":12,"context_line":"And change the order in which apply_requests and numa_fit_instance_to_host"},{"line_number":13,"context_line":"are called. Calling apply_requests first will remove devices from pools"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3ab451fb_bfd0d3ca","line":10,"updated":"2015-04-16 21:06:13.000000000","message":"s/Whithout/Without/","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":11647,"name":"Przemyslaw Czesnowicz","email":"przemyslaw.czesnowicz@intel.com","username":"pczesno"},"change_message_id":"7af6a21fe73bf36ed3179cf7c63ad7ee6f7d8df3","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix handling of pci_requests in consume_from_instance."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Properly retrieve requests from pci_requests in consume_from_instance."},{"line_number":10,"context_line":"Whithout this the call to numa_fit_instance_to_host will fail because"},{"line_number":11,"context_line":"it expects the request list."},{"line_number":12,"context_line":"And change the order in which apply_requests and numa_fit_instance_to_host"},{"line_number":13,"context_line":"are called. Calling apply_requests first will remove devices from pools"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3ab451fb_e27110e2","line":10,"in_reply_to":"3ab451fb_bfd0d3ca","updated":"2015-04-17 10:07:27.000000000","message":"Done","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"}],"nova/objects/instance_pci_requests.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a0277d9c8f9551143237c584737f20e696f8b70f","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    @classmethod"},{"line_number":159,"context_line":"    def from_dict(cls, pci_requests):"},{"line_number":160,"context_line":"        pci_requests \u003d copy.copy(pci_requests)"},{"line_number":161,"context_line":"        pci_requests[\u0027requests\u0027] \u003d [InstancePCIRequest(**request)"},{"line_number":162,"context_line":"                                    for request in pci_requests[\u0027requests\u0027]]"},{"line_number":163,"context_line":"        return cls(**pci_requests)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_bfe7b3ab","line":160,"updated":"2015-04-16 21:06:13.000000000","message":"This needs to be copy.deepcopy()\n\nBetter yet, don\u0027t reuse the same name for the variable. Instead, just do something like this:\n\n @classmethod\n def from_dict(cls, pci_requests):\n     objs \u003d [InstancePCIRequest(**request)\n             for request in pci_requests[\u0027requests\u0027]]\n     return cls(results\u003dobjs)","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":11647,"name":"Przemyslaw Czesnowicz","email":"przemyslaw.czesnowicz@intel.com","username":"pczesno"},"change_message_id":"d4c55aee34cbec81a13b7e0220890416bb4a50c5","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    @classmethod"},{"line_number":159,"context_line":"    def from_dict(cls, pci_requests):"},{"line_number":160,"context_line":"        pci_requests \u003d copy.copy(pci_requests)"},{"line_number":161,"context_line":"        pci_requests[\u0027requests\u0027] \u003d [InstancePCIRequest(**request)"},{"line_number":162,"context_line":"                                    for request in pci_requests[\u0027requests\u0027]]"},{"line_number":163,"context_line":"        return cls(**pci_requests)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_4863451b","line":160,"in_reply_to":"3ab451fb_8277ec01","updated":"2015-04-17 10:55:31.000000000","message":"You right about the deepcopy., Thanks.\n\nBut what you propose later wouldn\u0027t work as it would miss the instance_uuid field.","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":11647,"name":"Przemyslaw Czesnowicz","email":"przemyslaw.czesnowicz@intel.com","username":"pczesno"},"change_message_id":"d4c55aee34cbec81a13b7e0220890416bb4a50c5","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    @classmethod"},{"line_number":159,"context_line":"    def from_dict(cls, pci_requests):"},{"line_number":160,"context_line":"        pci_requests \u003d copy.copy(pci_requests)"},{"line_number":161,"context_line":"        pci_requests[\u0027requests\u0027] \u003d [InstancePCIRequest(**request)"},{"line_number":162,"context_line":"                                    for request in pci_requests[\u0027requests\u0027]]"},{"line_number":163,"context_line":"        return cls(**pci_requests)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_631aa270","line":160,"in_reply_to":"3ab451fb_aedad976","updated":"2015-04-17 10:55:31.000000000","message":"ok","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"925f0161d08de8ebd8844eeb419cc309f442a2da","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    @classmethod"},{"line_number":159,"context_line":"    def from_dict(cls, pci_requests):"},{"line_number":160,"context_line":"        pci_requests \u003d copy.copy(pci_requests)"},{"line_number":161,"context_line":"        pci_requests[\u0027requests\u0027] \u003d [InstancePCIRequest(**request)"},{"line_number":162,"context_line":"                                    for request in pci_requests[\u0027requests\u0027]]"},{"line_number":163,"context_line":"        return cls(**pci_requests)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_aedad976","line":160,"in_reply_to":"3ab451fb_bfe7b3ab","updated":"2015-04-17 10:26:04.000000000","message":"Agreed - also, I would name the method something other than from_dict - this name implies that there is a good reason for it to be a dict. But it\u0027s not really like that - the only reason we get it as a dict here is because of how broken request_spec is.\n\nMaybe: from_request_spec_instance_props ?","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":11647,"name":"Przemyslaw Czesnowicz","email":"przemyslaw.czesnowicz@intel.com","username":"pczesno"},"change_message_id":"7af6a21fe73bf36ed3179cf7c63ad7ee6f7d8df3","unresolved":false,"context_lines":[{"line_number":157,"context_line":""},{"line_number":158,"context_line":"    @classmethod"},{"line_number":159,"context_line":"    def from_dict(cls, pci_requests):"},{"line_number":160,"context_line":"        pci_requests \u003d copy.copy(pci_requests)"},{"line_number":161,"context_line":"        pci_requests[\u0027requests\u0027] \u003d [InstancePCIRequest(**request)"},{"line_number":162,"context_line":"                                    for request in pci_requests[\u0027requests\u0027]]"},{"line_number":163,"context_line":"        return cls(**pci_requests)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_8277ec01","line":160,"in_reply_to":"3ab451fb_bfe7b3ab","updated":"2015-04-17 10:07:27.000000000","message":"Done","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"d358f87a5e7c4452aa53d72799796bc384742627","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        pci_requests \u003d copy.deepcopy(pci_requests)"},{"line_number":161,"context_line":"        pci_requests[\u0027requests\u0027] \u003d [InstancePCIRequest(**request)"},{"line_number":162,"context_line":"                                    for request in pci_requests[\u0027requests\u0027]]"},{"line_number":163,"context_line":"        return cls(**pci_requests)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3ab451fb_c01a826e","line":163,"updated":"2015-04-17 14:29:20.000000000","message":"How about this instead?\n\n @classmethod\n def from_dict(cls, pci_requests):\n     objs \u003d [InstancePCIRequest(**request)\n             for request in pci_requests[\u0027requests\u0027]]\n     return cls(results\u003dobjs,\n                instance_uuid\u003dpci_request[\u0027instance_uuid\u0027])\n\nThat way there\u0027s no need to do any copying at all and you don\u0027t need the import copy","commit_id":"59e3a5593110d18782b08e70156342a8f1e8d38e"}],"nova/scheduler/host_manager.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"14852cfe30235cdfddc9e989095cba9eca9e91f6","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        if pci_requests and pci_requests[\u0027requests\u0027] and self.pci_stats:"},{"line_number":271,"context_line":"            pci_requests \u003d pci_requests.requests"},{"line_number":272,"context_line":"        else:"},{"line_number":273,"context_line":"            pci_requests \u003d None"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # Calculate the numa usage"},{"line_number":276,"context_line":"        host_numa_topology, _fmt \u003d hardware.host_topology_and_format_from_host("}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_5de4b7df","line":273,"updated":"2015-04-15 14:12:08.000000000","message":"So I am a bit confused by this TBH - looking at the bug, the only way the exception would happen is if we actually have the pci_requests field on the instance dict (instance is always a dict here because it comes from request_spec) but we don\u0027t in fact have any pci_requests.\n\nIndeed - this can happen even though pci_requests is a nullable field on the instance object, we actually never set it to None:\n\nhttps://github.com/openstack/nova/blob/feef80c1f88cc28f8625b19ebf43b190fae0ca08/nova/pci/request.py#L193\n\nThis would normally be fine if it weren\u0027t for the horrible request_spec, using the utterly and hopelessly broken base.obj_to_primitive, which would happily turn this into a dict, even though instance.pci_requests is falsey. Sigh...\n\nobj_to_primitive strikes again and makes us write code like this that is uninteligable without looking at the code of a different service in 3 places.\n\nSad","commit_id":"53a32003777db4354ec1f4165388ac867e0aca65"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"32d1b6e6a7bc49c849f27e3513936ae677f451ef","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        if pci_requests and pci_requests[\u0027requests\u0027] and self.pci_stats:"},{"line_number":271,"context_line":"            pci_requests \u003d pci_requests.requests"},{"line_number":272,"context_line":"        else:"},{"line_number":273,"context_line":"            pci_requests \u003d None"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"        # Calculate the numa usage"},{"line_number":276,"context_line":"        host_numa_topology, _fmt \u003d hardware.host_topology_and_format_from_host("}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_ee406436","line":273,"in_reply_to":"7aaa499b_5de4b7df","updated":"2015-04-15 16:12:11.000000000","message":"Yeah thanks for the explanation, now I got it.","commit_id":"53a32003777db4354ec1f4165388ac867e0aca65"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a0277d9c8f9551143237c584737f20e696f8b70f","unresolved":false,"context_lines":[{"line_number":39,"context_line":"from nova import utils"},{"line_number":40,"context_line":"from nova.virt import hardware"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"host_manager_opts \u003d ["},{"line_number":44,"context_line":"    cfg.MultiStrOpt(\u0027scheduler_available_filters\u0027,"},{"line_number":45,"context_line":"            default\u003d[\u0027nova.scheduler.filters.all_filters\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_bf11f35f","line":42,"updated":"2015-04-16 21:06:13.000000000","message":"Try to keep unrelated style/whitespace changes like this in separate style-only patches. Just FYI.","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":11647,"name":"Przemyslaw Czesnowicz","email":"przemyslaw.czesnowicz@intel.com","username":"pczesno"},"change_message_id":"7af6a21fe73bf36ed3179cf7c63ad7ee6f7d8df3","unresolved":false,"context_lines":[{"line_number":39,"context_line":"from nova import utils"},{"line_number":40,"context_line":"from nova.virt import hardware"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"host_manager_opts \u003d ["},{"line_number":44,"context_line":"    cfg.MultiStrOpt(\u0027scheduler_available_filters\u0027,"},{"line_number":45,"context_line":"            default\u003d[\u0027nova.scheduler.filters.all_filters\u0027],"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_c254d455","line":42,"in_reply_to":"3ab451fb_bf11f35f","updated":"2015-04-17 10:07:27.000000000","message":"Done","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"}],"nova/tests/unit/scheduler/test_host_manager.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"925f0161d08de8ebd8844eeb419cc309f442a2da","unresolved":false,"context_lines":[{"line_number":913,"context_line":"    @mock.patch(\u0027nova.virt.hardware.numa_fit_instance_to_host\u0027)"},{"line_number":914,"context_line":"    @mock.patch(\u0027nova.virt.hardware.instance_topology_from_instance\u0027)"},{"line_number":915,"context_line":"    @mock.patch(\u0027nova.virt.hardware.host_topology_and_format_from_host\u0027)"},{"line_number":916,"context_line":"    def test_stat_consumption_from_instance_pci(self, host_topo_mock,"},{"line_number":917,"context_line":"                                            instance_topo_mock,"},{"line_number":918,"context_line":"                                            numa_fit_mock,"},{"line_number":919,"context_line":"                                            numa_usage_mock):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3ab451fb_542c024a","line":916,"updated":"2015-04-17 10:26:04.000000000","message":"consume from instance tests are generally pretty broken. They mock out way too much - there is no reason to mock any of this stuff out we don\u0027t interact with anything there really.\n\nNot sure we should block on this as we want to get this bug fix in for RC2, but even though this test will confirm that we pass the pci_requests.requests content, seeing that it will still fail if we actually have the wrong type there does not make very confident that this will catch regressions.","commit_id":"7c3e8b0e77c4f186db01f24e17340cb7a7a965ca"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"fb2c78996f7e0ea0f62269bff8407c7e052e94c8","unresolved":false,"context_lines":[{"line_number":915,"context_line":"    @mock.patch(\u0027nova.virt.hardware.get_host_numa_usage_from_instance\u0027)"},{"line_number":916,"context_line":"    @mock.patch(\u0027nova.virt.hardware.numa_fit_instance_to_host\u0027)"},{"line_number":917,"context_line":"    @mock.patch(\u0027nova.virt.hardware.instance_topology_from_instance\u0027)"},{"line_number":918,"context_line":"    @mock.patch(\u0027nova.virt.hardware.host_topology_and_format_from_host\u0027)"},{"line_number":919,"context_line":"    def test_stat_consumption_from_instance_pci(self, host_topo_mock,"},{"line_number":920,"context_line":"                                            instance_topo_mock,"},{"line_number":921,"context_line":"                                            numa_fit_mock,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ab451fb_c8c4f593","line":918,"updated":"2015-04-17 10:32:51.000000000","message":"I think it would be good to stop mocking these and also pass in the instance in the format it would be passed in reality, meaning calling build_request_spec on an object.\n\nThen we can drop all the mocking and see if his stuff actually works.\n\nThis will require having realistic fake pci_stats as well on one of the fake compute nodes","commit_id":"b0d995b47882d07bdc8b9f76e9973789a0c643e3"},{"author":{"_account_id":11647,"name":"Przemyslaw Czesnowicz","email":"przemyslaw.czesnowicz@intel.com","username":"pczesno"},"change_message_id":"7f0c2ae42168cac78dad04712851e0aca0902670","unresolved":false,"context_lines":[{"line_number":915,"context_line":"    @mock.patch(\u0027nova.virt.hardware.get_host_numa_usage_from_instance\u0027)"},{"line_number":916,"context_line":"    @mock.patch(\u0027nova.virt.hardware.numa_fit_instance_to_host\u0027)"},{"line_number":917,"context_line":"    @mock.patch(\u0027nova.virt.hardware.instance_topology_from_instance\u0027)"},{"line_number":918,"context_line":"    @mock.patch(\u0027nova.virt.hardware.host_topology_and_format_from_host\u0027)"},{"line_number":919,"context_line":"    def test_stat_consumption_from_instance_pci(self, host_topo_mock,"},{"line_number":920,"context_line":"                                            instance_topo_mock,"},{"line_number":921,"context_line":"                                            numa_fit_mock,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3ab451fb_6348625c","line":918,"in_reply_to":"3ab451fb_c8c4f593","updated":"2015-04-17 10:55:41.000000000","message":"ok, i\u0027ll do what you propose","commit_id":"b0d995b47882d07bdc8b9f76e9973789a0c643e3"}]}
