summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/server
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-05-27 22:24:17 +0300
committerYaroslav Brustinov <ybrustin@cisco.com>2016-05-27 22:24:17 +0300
commit4607fb5588bbb7dc0a708ffd5f97fe99bee98dd2 (patch)
tree56af56c63a83d6e394ac7492db7965560dcc2abd /scripts/automation/trex_control_plane/server
parent7e22036a2a08be24719f4be7b81aa8a0e7ec759a (diff)
fix bug: value of argument 1.0 was counted as "True" and not being added
Diffstat (limited to 'scripts/automation/trex_control_plane/server')
-rwxr-xr-xscripts/automation/trex_control_plane/server/trex_server.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/server/trex_server.py b/scripts/automation/trex_control_plane/server/trex_server.py
index 81f3d28f..c1760236 100755
--- a/scripts/automation/trex_control_plane/server/trex_server.py
+++ b/scripts/automation/trex_control_plane/server/trex_server.py
@@ -14,7 +14,6 @@ import binascii
import socket
import errno
import signal
-import binascii
from common.trex_status_e import TRexStatus
from common.trex_exceptions import *
import subprocess
@@ -455,10 +454,12 @@ class CTRexServer(object):
# adding additional options to the command
trex_cmd_options = ''
for key, value in kwargs.iteritems():
- tmp_key = key.replace('_','-')
+ tmp_key = key.replace('_','-').lstrip('-')
dash = ' -' if (len(key)==1) else ' --'
- if (value == True) and (str(value) != '1'): # checking also int(value) to excape from situation that 1 translates by python to 'True'
+ if value is True:
trex_cmd_options += (dash + tmp_key)
+ elif value is False:
+ continue
else:
trex_cmd_options += (dash + '{k} {val}'.format( k = tmp_key, val = value ))