summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-02-21 08:34:28 -0500
committerimarom <imarom@cisco.com>2016-02-23 03:08:00 -0500
commitbc7f0b85b85a8deb6bc58bcca32ff11d9289cd92 (patch)
treec6a12c9f126f6b74acb6ce740e134dd00e746679 /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
parenta88db6885843221757f3cfb4bb3b2e74f57395bb (diff)
rate per stream
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
index aa09b0a1..d4ad8bd2 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_types.py
@@ -111,3 +111,9 @@ def validate_type(arg_name, arg, valid_types):
raise STLTypeError(arg_name, type(arg), valid_types)
else:
raise STLError('validate_type: valid_types should be type or list or tuple of types')
+
+# throws STLError if not exactly one argument is present
+def verify_exclusive_arg (args_list):
+ if not (len(filter(lambda x: x is not None, args_list)) == 1):
+ raise STLError('exactly one parameter from {0} should be provided'.format(args_list))
+