hardware: Flatten functions
This will make subsquent changes easier to review. Change-Id: Ia670e4d326613fe295d91bae45a379d700c33a5f
This commit is contained in:
committed by
John Garbutt
parent
a1d4cf25f9
commit
3f0711c3e3
@@ -1314,7 +1314,7 @@ def numa_fit_instance_to_host(
|
||||
{'required': len(instance_topology),
|
||||
'actual': len(host_topology)})
|
||||
return
|
||||
else:
|
||||
|
||||
# TODO(ndipanov): We may want to sort permutations differently
|
||||
# depending on whether we want packing/spreading over NUMA nodes
|
||||
for host_cell_perm in itertools.permutations(
|
||||
@@ -1333,12 +1333,12 @@ def numa_fit_instance_to_host(
|
||||
if got_cell is None:
|
||||
break
|
||||
cells.append(got_cell)
|
||||
if len(cells) == len(host_cell_perm):
|
||||
if not pci_requests:
|
||||
return objects.InstanceNUMATopology(cells=cells)
|
||||
elif ((pci_stats is not None) and
|
||||
pci_stats.support_requests(pci_requests,
|
||||
cells)):
|
||||
|
||||
if len(cells) != len(host_cell_perm):
|
||||
continue
|
||||
|
||||
if not pci_requests or ((pci_stats is not None) and
|
||||
pci_stats.support_requests(pci_requests, cells)):
|
||||
return objects.InstanceNUMATopology(cells=cells)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user