From: Christos Sfakianakis <csfakian(a)redhat.com>
Check its value against 'None' explicitly at the first 'if' clause.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
index 9faf7ec..c193987 100644
--- a/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/IperfFlowMeasurement.py
@@ -113,7 +113,7 @@ class IperfFlowMeasurement(BaseFlowMeasurement):
server_params = dict(bind = ipaddress(flow.receiver_bind),
oneoff = True)
- if flow.cpupin and flow.cpupin >= 0:
+ if flow.cpupin is not None and flow.cpupin >= 0:
if flow.parallel_streams == 1:
server_params["cpu_bind"] = flow.cpupin
else:
@@ -140,7 +140,7 @@ class IperfFlowMeasurement(BaseFlowMeasurement):
else:
raise RecipeError("Unsupported flow type
'{}'".format(flow.type))
- if flow.cpupin and flow.cpupin >= 0:
+ if flow.cpupin is not None and flow.cpupin >= 0:
if flow.parallel_streams == 1:
client_params["cpu_bind"] = flow.cpupin
else:
--
2.17.1