summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client_utils/yaml_utils.py
diff options
context:
space:
mode:
authorDan Klein <danklei@cisco.com>2015-10-20 09:12:33 +0300
committerDan Klein <danklei@cisco.com>2015-10-20 09:12:33 +0300
commit5abe21ffb26a15c2a63e90b5628d704e8211b599 (patch)
tree202fe09b0070f962da1e996673d7db21005a94d8 /scripts/automation/trex_control_plane/client_utils/yaml_utils.py
parentcf753587ffb7b89cff1863c74ca334b8c41fd0c0 (diff)
+ Added traffic options at stl directory
+ updated console to support multiplier on loading + fixed minor issues at yaml_utils and trex_streams objects + console not stable, YET
Diffstat (limited to 'scripts/automation/trex_control_plane/client_utils/yaml_utils.py')
-rwxr-xr-xscripts/automation/trex_control_plane/client_utils/yaml_utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/client_utils/yaml_utils.py b/scripts/automation/trex_control_plane/client_utils/yaml_utils.py
index 414744fc..60630a04 100755
--- a/scripts/automation/trex_control_plane/client_utils/yaml_utils.py
+++ b/scripts/automation/trex_control_plane/client_utils/yaml_utils.py
@@ -108,7 +108,6 @@ class CTRexYAMLLoader(object):
# validation on terminal type
# print "Validating terminal type %s" % k
res_ok, data = self.check_term_param_type(evaluated_obj.get(k), k, v, multiplier)
- # print "Validating: ", res_ok
if res_ok:
# data field contains the value to save
result_obj[k] = data
@@ -138,8 +137,13 @@ class CTRexYAMLLoader(object):
@staticmethod
def _calc_final_value(val, multiplier, multiply):
+ def to_num(s):
+ try:
+ return int(s)
+ except ValueError:
+ return float(s)
if multiply:
- return (val * multiplier)
+ return val * to_num(multiplier)
else:
return val