Skip to content

Commit

Permalink
Merge pull request #6 from Supernarthur/master
Browse files Browse the repository at this point in the history
Added a port param in Client class to handle 2018.5+ nexis versions
  • Loading branch information
predat authored Aug 14, 2018
2 parents c5ddd0b + 5674cd6 commit 8d90ab6
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=ISIS_SOAP_PORT):
"""
: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 8d90ab6

Please sign in to comment.