summaryrefslogtreecommitdiffstats
path: root/scripts/automation
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-04-18 15:18:59 +0300
committerimarom <imarom@cisco.com>2016-04-18 15:19:46 +0300
commitb12cc7fda4f8c488800696abdb2fba7c3cfc82a4 (patch)
treecad3edb1805210cb9cbb598d100332ad30a7cdbc /scripts/automation
parent7e5993941829e5fd1bb9ab3c6ac624d9aa800c37 (diff)
minor fix
Diffstat (limited to 'scripts/automation')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/console/trex_console.py3
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py13
2 files changed, 15 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/console/trex_console.py b/scripts/automation/trex_control_plane/stl/console/trex_console.py
index 589f1d35..a126bf35 100755
--- a/scripts/automation/trex_control_plane/stl/console/trex_console.py
+++ b/scripts/automation/trex_control_plane/stl/console/trex_console.py
@@ -431,6 +431,9 @@ class TRexConsole(TRexGeneralCmd):
def help_release (self):
self.do_release("-h")
+ def help_reacquire (self):
+ self.do_reacquire("-h")
+
############### start
def complete_start(self, text, line, begidx, endidx):
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 76fbf3b8..63d77637 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
@@ -2158,7 +2158,17 @@ class STLClient(object):
@__console
def reacquire_line (self, line):
- '''reacquire all the ports under your username'''
+ '''reacquire all the ports under your username which are not acquired by your session'''
+
+ parser = parsing_opts.gen_parser(self,
+ "reacquire",
+ self.reacquire_line.__doc__)
+
+ opts = parser.parse_args(line.split())
+ if opts is None:
+ return
+
+ # find all the on-owned ports under your name
my_unowned_ports = list_difference([k for k, v in self.ports.items() if v.get_owner() == self.username], self.get_acquired_ports())
if not my_unowned_ports:
self.logger.log("reacquire - no unowned ports under '{0}'".format(self.username))
@@ -2167,6 +2177,7 @@ class STLClient(object):
self.acquire(ports = my_unowned_ports, force = True)
return True
+
@__console
def disconnect_line (self, line):
self.disconnect()