summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/console/parsing_opts.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/console/parsing_opts.py')
-rwxr-xr-xscripts/automation/trex_control_plane/console/parsing_opts.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/automation/trex_control_plane/console/parsing_opts.py b/scripts/automation/trex_control_plane/console/parsing_opts.py
index ab678586..14e8c563 100755
--- a/scripts/automation/trex_control_plane/console/parsing_opts.py
+++ b/scripts/automation/trex_control_plane/console/parsing_opts.py
@@ -23,6 +23,11 @@ FORCE = 10
# list of ArgumentGroup types
MUTEX = 1
+def check_negative(value):
+ ivalue = int(value)
+ if ivalue < 0:
+ raise argparse.ArgumentTypeError("non positive value provided: '{0}'".format(value))
+ return ivalue
def match_time_unit(val):
'''match some val against time shortcut inputs '''