summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-09-21 18:12:46 +0300
committerimarom <imarom@cisco.com>2016-09-25 15:08:06 +0300
commit2cf444195c3d8a0215216e5f1899fded15bd7627 (patch)
tree10f17d20f2bcc98a1635f767a7acca97a6e0eadb /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py
parent0b520a31268bea0492795a56c4a65d93cdb21676 (diff)
Splitter - padding for non circular VMs
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py
index e1de6b55..65333e0f 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/parsing_opts.py
@@ -213,19 +213,25 @@ def is_valid_file(filename):
return filename
-def decode_tunables_to_dict (**kwargs):
- return kwargs
def decode_tunables (tunable_str):
- try:
- tunables = [eval('decode_tunables_to_dict({0})'.format(t)) for t in tunable_str.split('#')]
+ tunables = {}
- except (SyntaxError, NameError):
- raise argparse.ArgumentTypeError("bad syntax for tunables: {0}".format(tunable_str))
+ # split by diaz to tokens
+ tokens = tunable_str.split('#')
+
+ # each token is of form X=Y
+ for token in tokens:
+ print(token)
+ m = re.search('(.*)=(.*)', token)
+ if not m:
+ raise argparse.ArgumentTypeError("bad syntax for tunables: {0}".format(token))
+ tunables[m.group(1)] = m.group(2)
return tunables
+
OPTIONS_DB = {MULTIPLIER: ArgumentPack(['-m', '--multiplier'],
{'help': match_multiplier_help,
'dest': "mult",