Skip to content
Snippets Groups Projects
Commit 7a84ea8d authored by Roberto Rubino's avatar Roberto Rubino
Browse files

double checked name of variable __ietf_root

parent 71966646
No related branches found
No related tags found
1 merge request!54Release 2.0.0
......@@ -26,20 +26,20 @@ class IETFApiDriver(_Driver):
self.__lock = threading.Lock()
self.__started = threading.Event()
self.__terminate = threading.Event()
self.__tapi_root = 'https://' + address + ':' + str(port)
self.__ietf_root = 'https://' + address + ':' + str(port)
self.__timeout = int(settings.get('timeout', 120))
def Connect(self) -> bool:
url = self.__tapi_root + '/nmswebs/restconf/data/ietf-network:networks'
url = self.__ietf_root + '/nmswebs/restconf/data/ietf-network:networks'
with self.__lock:
if self.__started.is_set(): return True
try:
requests.get(url, timeout=self.__timeout, verify=False)
except requests.exceptions.Timeout:
LOGGER.exception('Timeout connecting {:s}'.format(str(self.__tapi_root)))
LOGGER.exception('Timeout connecting {:s}'.format(str(self.__ietf_root)))
return False
except Exception: # pylint: disable=broad-except
LOGGER.exception('Exception connecting {:s}'.format(str(self.__tapi_root)))
LOGGER.exception('Exception connecting {:s}'.format(str(self.__ietf_root)))
return False
else:
self.__started.set()
......@@ -62,7 +62,7 @@ class IETFApiDriver(_Driver):
for i, resource_key in enumerate(resource_keys):
str_resource_name = 'resource_key[#{:d}]'.format(i)
chk_string(str_resource_name, resource_key, allow_empty=False)
results.extend(config_getter(self.__tapi_root, resource_key, self.__timeout))
results.extend(config_getter(self.__ietf_root, resource_key, self.__timeout))
return results
......@@ -82,7 +82,7 @@ class IETFApiDriver(_Driver):
uuid = find_key(resource, 'uuid')
data = create_connectivity_service(
self.__tapi_root, self.__timeout, uuid, node_id_src, tp_id_src, node_id_dst, tp_id_dst, vlan_id)
self.__ietf_root, self.__timeout, uuid, node_id_src, tp_id_src, node_id_dst, tp_id_dst, vlan_id)
results.extend(data)
return results
......@@ -94,7 +94,7 @@ class IETFApiDriver(_Driver):
for resource in resources:
LOGGER.info('resource = {:s}'.format(str(resource)))
uuid = find_key(resource, 'uuid')
results.extend(delete_connectivity_service(self.__tapi_root, self.__timeout, uuid))
results.extend(delete_connectivity_service(self.__ietf_root, self.__timeout, uuid))
return results
def SubscribeState(self, subscriptions : List[Tuple[str, float, float]]) -> List[Union[bool, Exception]]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment