Skip to content

Commit

Permalink
Added a port param in Client class to handle 2018.5+ nexis versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Desplanches committed Aug 14, 2018
1 parent c5ddd0b commit 4e0b0fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pyIsis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@ class Client(object):
>>> client.get_workspaces()
"""

def __init__(self, hostname, username, password):
def __init__(self, hostname, username, password, port=80):
"""
:param hostname: hostname or ip of the Avid Isis Storage server
:param username: a valid username
:param password: password of the user
:param port: the port of the legacy web interface (80 or 3002)
"""
self.hostname = hostname
self.username = username
self.password = password
self.port = port

# must be present for __del__ to gracefully exit failed session
self.token = None

url = ISIS_SOAP_URL.format(hostname=self.hostname,
port=ISIS_SOAP_PORT)
port=self.port)

try:
self._client = osa.Client(url)
Expand Down Expand Up @@ -299,7 +301,7 @@ def total(self):


def _send(self, values):
url = 'http://%s/v2/ida' % self.hostname
url = 'http://%s:%s/v2/ida' % (self.hostname, self.port)
authinfo = 'avidagent=12345; AdminServerToken=%s; AgentLoginName=%s' % \
(self.token, self.username)
headers = {'User-Agent': '12345', 'Cookie': authinfo}
Expand Down

0 comments on commit 4e0b0fa

Please sign in to comment.