diff --git a/VERSION b/VERSION index 17e51c385..d917d3e26 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1 +0.1.2 diff --git a/setup.py b/setup.py index 8a7ed211c..bf4dad76b 100644 --- a/setup.py +++ b/setup.py @@ -68,7 +68,7 @@ ], extras_require={ 'dev': [ - 'snappi==0.1.16', + 'snappi>=0.1.16,<0.2.0', 'pytest', 'flake8==3.8.4', 'dpkt==1.9.4', diff --git a/snappi_ixnetwork/ixnetworkapi.py b/snappi_ixnetwork/ixnetworkapi.py index a94d8801b..ef07b6ad5 100644 --- a/snappi_ixnetwork/ixnetworkapi.py +++ b/snappi_ixnetwork/ixnetworkapi.py @@ -26,8 +26,7 @@ class Api(snappi.Api): This is not required when connecting to single session environments """ def __init__(self, - address='127.0.0.1', - port='11009', + host=None, username='admin', password='admin', license_servers=[], @@ -39,9 +38,10 @@ def __init__(self, - username (str): The username to be used for authentication - password (str): The password to be used for authentication """ - super(Api, self).__init__() - self._address = address - self._port = port + super(Api, self).__init__( + host='https://127.0.0.1:11009' if host is None else host + ) + self._address, self._port = self._get_addr_port(self.host) self._username = username self._password = password self._license_servers = license_servers @@ -55,6 +55,19 @@ def __init__(self, self.ngpf = Ngpf(self) self.traffic_item = TrafficItem(self) + def _get_addr_port(self, host): + items = host.split('/') + items = items[-1].split(':') + + addr = items[0] + if len(items) == 2: + return addr, items[-1] + else: + if host.startswith('https'): + return addr, '443' + else: + return addr, '80' + @property def config(self): return self._config