summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
diff options
context:
space:
mode:
authorVyacheslav Ogai <vyacheslav.ogai@gmail.com>2016-11-30 12:08:27 +0200
committerHanoh Haim <hhaim@cisco.com>2016-12-19 16:04:07 +0200
commit720a1fa8295271a8445c6698ace31443aaf9214f (patch)
treee4b224a2cb84214041a1200b9b5101db734cc0e7 /scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
parentadba1571de39dc65a3de192ec0a86828c2a95ded (diff)
Update _existed_flow_var_names. Now it returns all Flow var names.
Signed-off-by: Vyacheslav Ogai <vyacheslav.ogai@gmail.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py b/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
index 9e617a81..9598ea94 100755
--- a/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
+++ b/scripts/automation/trex_control_plane/stl/services/scapy_server/scapy_service.py
@@ -807,7 +807,14 @@ class Scapy_service(Scapy_service_api):
return {}
def _existed_flow_var_names(self, instructions):
- return {"map": dict((instruction['parameters']['name'], instruction['parameters']['name']) for instruction in instructions if instruction['id'] == "STLVmFlowVar")}
+ return {"map": dict((instruction['parameters']['name'], instruction['parameters']['name']) for instruction in instructions if self._nameParamterExist(instruction))}
+
+ def _nameParamterExist(self, instruction):
+ try:
+ instruction['parameters']['name']
+ return True
+ except KeyError:
+ return False
def _curent_pkt_protocol_fields(self, given_protocol_ids, delimiter):
given_protocol_classes = [c for c in Packet.__subclasses__() if c.__name__ in given_protocol_ids and c.__name__ != "Ether"]