Skip to content

Commit

Permalink
ofed_scripts/utils/mlnx_tune: Fix error when trying to read node info…
Browse files Browse the repository at this point in the history
…rmation

python's subprocess can't handle pipeline commands.
The command will execute without grep expression and the relevant
function handle the output.

Signed-off-by: Bar Tuaf <[email protected]>
  • Loading branch information
Bar Tuaf authored and vladsokolovsky committed Jul 31, 2019
1 parent 48eae51 commit 63ce184
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ofed_scripts/utils/mlnx_tune
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ from threading import Timer

VERSION_MAJOR = "4"
VERSION_MINOR = "6"
VERSION_BUILD = "3"
VERSION_BUILD = "4"

INDENT = 1
NA = "N/A"
Expand All @@ -64,7 +64,7 @@ FIREWALL_IPTABLES_SERVICE = "iptables"
FIREWALL_IP6TABLES_SERVICE = "ip6tables"

CPU_MAX_PERFORMANCE_CMD = "echo performance > /sys/devices/system/cpu/cpu%s/cpufreq/scaling_governor"
NUMA_NODES_CMD = "ls /sys/devices/system/node/ | grep node"
NUMA_NODES_CMD = "ls /sys/devices/system/node/"
CPUINFO_CMD = "cat /proc/cpuinfo"
GET_ARCHITECTURE_INFO_CMD = "uname -m"
LSCPU_CMD = "lscpu"
Expand Down Expand Up @@ -779,7 +779,8 @@ class Cpu:
(rc, output) = run_command_warn_when_fail(NUMA_NODES_CMD, "Unable to collect NUMA node info.")
if not rc:
for line in output.split("\n"):
arr.append(int(line.replace('node','').strip()))
if "node" in line:
arr.append(int(line.replace('node','').strip()))
self.sockets = len(arr)

socket_dict = {}
Expand Down

0 comments on commit 63ce184

Please sign in to comment.