From 4e0b0fafc9aaf58a7ed49261a443790de47ccb79 Mon Sep 17 00:00:00 2001 From: Arthur Desplanches Date: Tue, 14 Aug 2018 12:23:40 +0200 Subject: [PATCH 1/2] Added a port param in Client class to handle 2018.5+ nexis versions --- pyIsis/connection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyIsis/connection.py b/pyIsis/connection.py index 9fa1102..d803026 100644 --- a/pyIsis/connection.py +++ b/pyIsis/connection.py @@ -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) @@ -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} From 5674cd66df066800e098aba294533317f38ba012 Mon Sep 17 00:00:00 2001 From: Arthur Desplanches Date: Tue, 14 Aug 2018 13:38:33 +0200 Subject: [PATCH 2/2] Pointed Client class port default value to global variable ISIS_SOAP_PORT --- pyIsis/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyIsis/connection.py b/pyIsis/connection.py index d803026..73a4aa6 100644 --- a/pyIsis/connection.py +++ b/pyIsis/connection.py @@ -36,7 +36,7 @@ class Client(object): >>> client.get_workspaces() """ - def __init__(self, hostname, username, password, port=80): + 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