aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/InterfaceUtil.py
diff options
context:
space:
mode:
authorMaros Mullner <maros.mullner@pantheon.tech>2020-03-10 11:04:54 +0100
committerPeter Mikus <pmikus@cisco.com>2020-03-16 06:47:04 +0000
commit41b29c01d434b4536c33903423e1b28900e829bd (patch)
treef1e8e1211d6586ad91b6fa9eabeeaba0bd42e15e /resources/libraries/python/InterfaceUtil.py
parentacd320f64d2049b2dfe6c4616d770383ff67f20d (diff)
Final changes for AWS.
Modified cpuutils numa to work with aws 18xlarge instances. Added dmidecode package to calibration role as is not installed by default. Added required constants Signed-off-by: Maros Mullner <maros.mullner@pantheon.tech> Change-Id: I99608d9df3cff0b085ad26c30e339216b17581eb
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r--resources/libraries/python/InterfaceUtil.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 0333c9c092..b6647ef32a 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -695,14 +695,6 @@ class InterfaceUtil:
:raises ValueError: If numa node ia less than 0.
:raises RuntimeError: If update of numa node failed.
"""
- def check_cpu_node_count(node_n, val):
- val = int(val)
- if val < 0:
- if CpuUtils.cpu_node_count(node_n) == 1:
- val = 0
- else:
- raise ValueError
- return val
ssh = SSH()
for if_key in Topology.get_node_interfaces(node):
if_pci = Topology.get_interface_pci_addr(node, if_key)
@@ -712,7 +704,7 @@ class InterfaceUtil:
ret, out, _ = ssh.exec_command(cmd)
if ret == 0:
try:
- numa_node = check_cpu_node_count(node, out)
+ numa_node = 0 if int(out) < 0 else int(out)
except ValueError:
logger.trace(
f"Reading numa location failed for: {if_pci}"