Skip to content

Commit

Permalink
Update ixnetwork_ixia_client_impl.py (#1) (#174)
Browse files Browse the repository at this point in the history
Signed-off-by: Vinod Kumar <[email protected]>
Co-authored-by: vkuma82 <[email protected]>
  • Loading branch information
2 people authored and yuriilisovskyi committed Mar 30, 2023
1 parent b2ea8d0 commit ab3625a
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ixnetwork_restpy.assistants.statistics.statviewassistant import StatViewAssistant as SVA
from ixnetwork_restpy.files import Files
from ixnetwork_restpy.testplatform.testplatform import TestPlatform
from ixnetwork_restpy import SessionAssistant, Files


class IxnetworkIxiaClientImpl(IxnetworkIxiaClient):
Expand Down Expand Up @@ -69,12 +70,17 @@ def run_connect(self, device, command, *argv, **kwarg):
cport = param.get("client_port", 443)
if not caddr:
return 0, "No Address to connect!"
gw = TestPlatform(ip_address=caddr, rest_port=cport)
gw.Authenticate(device.username, device.password)
# session = gw.Sessions.find()[0]
# device.applog.info(session)
# if session.Id == -1:
session = gw.Sessions.add()

gw = SessionAssistant(
IpAddress=caddr,
RestPort=cport,
UserName=device.username,
Password=device.password,
SessionName="DENT",
ClearConfig=True
) # ,LogLevel='info'
session = gw.Session

device.applog.info("Connected to Linux Gateway Session ID: %d" % session.Id)
device.applog.info("Reserving test ports, and may take a minute...")
IxnetworkIxiaClientImpl.session = session
Expand Down

0 comments on commit ab3625a

Please sign in to comment.