aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/TrafficGenerator.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/TrafficGenerator.py')
-rw-r--r--resources/libraries/python/TrafficGenerator.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/resources/libraries/python/TrafficGenerator.py b/resources/libraries/python/TrafficGenerator.py
index 334e299f3e..cc968f8e09 100644
--- a/resources/libraries/python/TrafficGenerator.py
+++ b/resources/libraries/python/TrafficGenerator.py
@@ -443,10 +443,10 @@ class TrafficGenerator(AbstractMeasurer):
# we need to encode them, so that repr() does not lead with 'u'.
if isinstance(rate, unicode):
rate = rate.encode("utf-8")
- if isinstance(duration, unicode):
- duration = duration.encode("utf-8")
- if isinstance(warmup_time, unicode):
- warmup_time = warmup_time.encode("utf-8")
+ if not isinstance(duration, (float, int)):
+ duration = float(duration)
+ if not isinstance(warmup_time, (float, int)):
+ warmup_time = float(warmup_time)
command = (
"sh -c '{tool}/resources/tools/trex/trex_stateless_profile.py"
" --profile {prof}/resources/traffic_profiles/trex/{traffic}.py"