From: imarom Date: Thu, 30 Mar 2017 14:20:40 +0000 (+0300) Subject: check for service mode ports should be from among the acquired ports X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=2c839ec5098bf1ad39ec574729891c622a485083;p=trex.git check for service mode ports should be from among the acquired ports only any non acquired ports should be ignored Signed-off-by: imarom --- diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py index 6f6e8bfd..b48732d6 100755 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py @@ -1394,12 +1394,17 @@ class STLClient(object): for port_id, port_obj in self.ports.items() if port_obj.is_acquired() and port_obj.is_resolved()] - - def get_service_enabled_ports(self): - return [port_id - for port_id, port_obj in self.ports.items() - if port_obj.is_service_mode_on()] + def get_service_enabled_ports(self, owned = True): + if owned: + return [port_id + for port_id, port_obj in self.ports.items() + if port_obj.is_service_mode_on() and port_obj.is_acquired()] + else: + return [port_id + for port_id, port_obj in self.ports.items() + if port_obj.is_service_mode_on()] + # get paused ports def get_paused_ports (self, owned = True): @@ -4562,4 +4567,4 @@ class STLClient(object): return - \ No newline at end of file +