diff --git a/src/device/service/drivers/gnmi_openconfig/GnmiSessionHandler.py b/src/device/service/drivers/gnmi_openconfig/GnmiSessionHandler.py index dd542c0dc8c5824890814e95fd19327cb79e748e..9c2c0abb33d1789c2a3fb78f91790c2742b1fc31 100644 --- a/src/device/service/drivers/gnmi_openconfig/GnmiSessionHandler.py +++ b/src/device/service/drivers/gnmi_openconfig/GnmiSessionHandler.py @@ -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: diff --git a/src/device/service/drivers/gnmi_openconfig/handlers/YangHandler.py b/src/device/service/drivers/gnmi_openconfig/handlers/YangHandler.py index fe8672187f4d2affdf0db1f76b76a4ba2600c6f7..32a15ca2e6f151d3133ee57d14184d0000b6503f 100644 --- a/src/device/service/drivers/gnmi_openconfig/handlers/YangHandler.py +++ b/src/device/service/drivers/gnmi_openconfig/handlers/YangHandler.py @@ -23,6 +23,7 @@ YANG_SEARCH_PATHS = ':'.join([ YANG_MODULES = [ 'iana-if-type', + 'openconfig-bgp-types', 'openconfig-vlan-types', 'openconfig-interfaces',