Skip to content
Snippets Groups Projects
Commit 01019ca8 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device component - gNMI OpenConfig Driver:

- Added yang module "openconfig-bgp-types"
- Enabled some debug log messages
parent 083c9d0f
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!172Resolve "(CTTC) Extend gNMI-OpenConfig SBI driver"
......@@ -95,22 +95,24 @@ class GnmiSessionHandler:
str_resource_name = 'resource_key[#{:d}]'.format(i)
try:
chk_string(str_resource_name, resource_key, allow_empty=False)
#self._logger.debug('[GnmiSessionHandler:get] resource_key = {:s}'.format(str(resource_key)))
self._logger.debug('[GnmiSessionHandler:get] resource_key = {:s}'.format(str(resource_key)))
str_path = get_path(resource_key)
#self._logger.debug('[GnmiSessionHandler:get] str_path = {:s}'.format(str(str_path)))
self._logger.debug('[GnmiSessionHandler:get] str_path = {:s}'.format(str(str_path)))
get_request.path.append(path_from_string(str_path))
except Exception as e: # pylint: disable=broad-except
MSG = 'Exception parsing {:s}: {:s}'
self._logger.exception(MSG.format(str_resource_name, str(resource_key)))
parsing_results.append((resource_key, e)) # if validation fails, store the exception
self._logger.debug('parsing_results={:s}'.format(str(parsing_results)))
if len(parsing_results) > 0:
return parsing_results
metadata = [('username', self._username), ('password', self._password)]
timeout = None # GNMI_SUBSCRIPTION_TIMEOUT = int(sampling_duration)
get_reply = self._stub.Get(get_request, metadata=metadata, timeout=timeout)
#self._logger.info('get_reply={:s}'.format(grpc_message_to_json_string(get_reply)))
self._logger.debug('get_reply={:s}'.format(grpc_message_to_json_string(get_reply)))
results = []
#results[str_filter] = [i, None, False] # (index, value, processed?)
......@@ -127,7 +129,7 @@ class GnmiSessionHandler:
# resource_key_tuple[2] = True
for update in notification.update:
#self._logger.info('update={:s}'.format(grpc_message_to_json_string(update)))
self._logger.debug('update={:s}'.format(grpc_message_to_json_string(update)))
str_path = path_to_string(update.path)
#resource_key_tuple = results.get(str_path)
#if resource_key_tuple is None:
......
......@@ -23,6 +23,7 @@ YANG_SEARCH_PATHS = ':'.join([
YANG_MODULES = [
'iana-if-type',
'openconfig-bgp-types',
'openconfig-vlan-types',
'openconfig-interfaces',
......
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