diff options
author | 2016-04-12 02:49:21 +0300 | |
---|---|---|
committer | 2016-04-12 02:49:21 +0300 | |
commit | 3117eab2951df10e3e9bddc858b3a8c3e38628f6 (patch) | |
tree | 7a85244aba941c666b3793934c48728aeb5e4c61 /scripts/automation/trex_control_plane/stl/trex_stl_lib/utils | |
parent | 145a106abceaeb10f62dd40bc11010932f4b9576 (diff) |
hltapi: modify and remove traffic fixes
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/utils')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py index ae74e932..e176ca99 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/utils/common.py @@ -49,11 +49,12 @@ def random_id_gen(length=8): # try to get number from input, return None in case of fail def get_number(input): try: - if type(input) in (int, long): - return input - return int(input) + return long(input) except: - return None + try: + return int(input) + except: + return None def list_intersect(l1, l2): return list(filter(lambda x: x in l2, l1)) |