summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/client/trex_stateless_client.py
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-12-10 03:43:55 -0500
committerimarom <imarom@cisco.com>2015-12-10 05:54:45 -0500
commit7567166ca52bd136ce08c06dcbd48c0dfd67210f (patch)
treea579cd80a0cd47476d0ac4fd47c0e6a5e9628d3c /scripts/automation/trex_control_plane/client/trex_stateless_client.py
parent95c2405d6373ca3c6b69efc3faf293cd41a55c76 (diff)
removed session id - not necessary
Diffstat (limited to 'scripts/automation/trex_control_plane/client/trex_stateless_client.py')
-rwxr-xr-xscripts/automation/trex_control_plane/client/trex_stateless_client.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/scripts/automation/trex_control_plane/client/trex_stateless_client.py b/scripts/automation/trex_control_plane/client/trex_stateless_client.py
index 43ebea9d..6907c9c2 100755
--- a/scripts/automation/trex_control_plane/client/trex_stateless_client.py
+++ b/scripts/automation/trex_control_plane/client/trex_stateless_client.py
@@ -54,7 +54,6 @@ class CTRexStatelessClient(object):
super(CTRexStatelessClient, self).__init__()
self.user = username
- self.session_id = random.getrandbits(32)
self.comm_link = CTRexStatelessClient.CCommLink(server, sync_port, virtual)
@@ -85,10 +84,6 @@ class CTRexStatelessClient(object):
self.connected = False
- # when the client gets out
- def shutdown (self):
- self.release(self.get_acquired_ports())
-
# returns the port object
def get_port (self, port_id):
@@ -296,6 +291,9 @@ class CTRexStatelessClient(object):
# connection sequence
def connect(self, force = False):
+ if self.is_connected():
+ self.disconnect()
+
# clear this flag
self.connected = False
@@ -335,7 +333,7 @@ class CTRexStatelessClient(object):
speed = self.system_info['ports'][port_id]['speed']
driver = self.system_info['ports'][port_id]['driver']
- self.ports[port_id] = Port(port_id, speed, driver, self.user, self.session_id, self.comm_link)
+ self.ports[port_id] = Port(port_id, speed, driver, self.user, self.comm_link)
# sync the ports
@@ -365,8 +363,15 @@ class CTRexStatelessClient(object):
def disconnect(self):
+ # release any previous acquired ports
+ if self.is_connected():
+ self.release(self.get_acquired_ports())
+
self.comm_link.disconnect()
self.async_client.disconnect()
+
+ self.connected = False
+
return RC_OK()