Loading src/device/service/drivers/gnmi_openconfig/GnmiSessionHandler.py +6 −4 Original line number Diff line number Diff line Loading @@ -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?) Loading @@ -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: Loading src/device/service/drivers/gnmi_openconfig/handlers/YangHandler.py +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ YANG_SEARCH_PATHS = ':'.join([ YANG_MODULES = [ 'iana-if-type', 'openconfig-bgp-types', 'openconfig-vlan-types', 'openconfig-interfaces', Loading Loading
src/device/service/drivers/gnmi_openconfig/GnmiSessionHandler.py +6 −4 Original line number Diff line number Diff line Loading @@ -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?) Loading @@ -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: Loading
src/device/service/drivers/gnmi_openconfig/handlers/YangHandler.py +1 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ YANG_SEARCH_PATHS = ':'.join([ YANG_MODULES = [ 'iana-if-type', 'openconfig-bgp-types', 'openconfig-vlan-types', 'openconfig-interfaces', Loading