From 4607fb5588bbb7dc0a708ffd5f97fe99bee98dd2 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Fri, 27 May 2016 22:24:17 +0300 Subject: fix bug: value of argument 1.0 was counted as "True" and not being added --- scripts/automation/trex_control_plane/server/trex_server.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/automation/trex_control_plane/server') 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 )) -- cgit 1.2.3-korg