)]}'
{"nova/scheduler/filters/pci_passthrough_filter.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"35c2d54ca1f18b3d307e05e9e6e023862bc5c9d4","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        pci_requests \u003d spec_obj.pci_requests"},{"line_number":46,"context_line":"        if not pci_requests or not pci_requests.requests:"},{"line_number":47,"context_line":"            return True"},{"line_number":48,"context_line":"        if not host_state.pci_stats.support_requests(pci_requests.requests):"},{"line_number":49,"context_line":"            LOG.debug(\"%(host_state)s doesn\u0027t have the required PCI devices\""},{"line_number":50,"context_line":"                      \" (%(requests)s)\","},{"line_number":51,"context_line":"                      {\u0027host_state\u0027: host_state, \u0027requests\u0027: pci_requests})"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_3808b228","line":48,"updated":"2017-01-25 05:45:42.000000000","message":"From the bug report, it talks about host_state.pci_stats is None\n\n2017-01-19 06:00:35.887 105364 ERROR oslo_messaging.rpc.server if not host_state.pci_stats.support_requests(pci_requests.requests):\n2017-01-19 06:00:35.887 105364 ERROR oslo_messaging.rpc.server AttributeError: \u0027NoneType\u0027 object has no attribute \u0027support_requests\u0027\n\nSo I think we should check whether host_state.pci_stats is None?\n\nAnd the host_state.pci_stats looks like have a chance to be None without Ironic, due to this case\nhttps://github.com/openstack/nova/blob/master/nova/scheduler/host_manager.py#L186","commit_id":"49275ff0eedaeb11d21011f7249c0c5a8161568e"},{"author":{"_account_id":12171,"name":"Moshe Levi","email":"moshele@nvidia.com","username":"moshele"},"change_message_id":"8d153efaf032bbb6c15c28a3d8da6df1646f295c","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        pci_requests \u003d spec_obj.pci_requests"},{"line_number":46,"context_line":"        if not pci_requests or not pci_requests.requests:"},{"line_number":47,"context_line":"            return True"},{"line_number":48,"context_line":"        if not host_state.pci_stats.support_requests(pci_requests.requests):"},{"line_number":49,"context_line":"            LOG.debug(\"%(host_state)s doesn\u0027t have the required PCI devices\""},{"line_number":50,"context_line":"                      \" (%(requests)s)\","},{"line_number":51,"context_line":"                      {\u0027host_state\u0027: host_state, \u0027requests\u0027: pci_requests})"}],"source_content_type":"text/x-python","patch_set":2,"id":"5a3905b3_141ade6e","line":48,"in_reply_to":"5a3905b3_3808b228","updated":"2017-01-25 08:32:47.000000000","message":"I think  the logic should be as following:\n\ncase 1 -\u003e check for empty pci_requests\nif not pci_requests or not pci_requests.requests:\n    return True\n\ncase 2 -\u003e we have pci request but the host don\u0027t have host_state.pci_stats \nif not host_state.pci_stats\n    return False\n\ncase 3-\u003e we have pci request and the host pci_stats is not null \nif not host_state.pci_stats.support_requests\n\nIn the bug I opened the problem was that even when we have empty pci_request we would still try to check the host_state.pci_stats.support_requests. And for Ironic we don\u0027t have host_state.pci_stats.","commit_id":"49275ff0eedaeb11d21011f7249c0c5a8161568e"}]}
