diff --git a/src/device/service/drivers/gnmi_openconfig/handlers/Interface.py b/src/device/service/drivers/gnmi_openconfig/handlers/Interface.py index cb913d90730c5beaec6e93d477bcdd972744d504..c471faf2e12842654739552707f86d6f1f478ed9 100644 --- a/src/device/service/drivers/gnmi_openconfig/handlers/Interface.py +++ b/src/device/service/drivers/gnmi_openconfig/handlers/Interface.py @@ -92,12 +92,34 @@ class InterfaceHandler(_Handler): LOGGER.warning('Getting...') try: obj = objects_to_free.get_nowait() - LOGGER.warning('Releasing: {:s}'.format(str(obj))) - if obj is None: continue - LOGGER.warning('Releasing: {:s} => {:s}'.format( - str(obj.path()), str(obj.print_mem('json')) - )) + if obj is None: + LOGGER.warning('Item is None') + continue + + try: + type_obj = type(obj) + LOGGER.warning('Releasing[type]: {:s}'.format(str(type_obj))) + except: + LOGGER.exception('Releasing[type]: <failed>') + + try: + str_obj = str(obj) + if str_obj is not None: + LOGGER.warning('Releasing[str]: {:s}'.format(str_obj)) + except: + LOGGER.exception('Releasing[str]: <failed>') + + try: + repr_obj = repr(obj) + if repr_obj is not None: + LOGGER.warning('Releasing[repr]: {:s}'.format(str(repr_obj))) + except: + LOGGER.exception('Releasing[repr]: <failed>') + try: + LOGGER.warning('Releasing: {:s} => {:s}'.format( + str(obj.path()), str(obj.print_mem('json')) + )) LOGGER.warning('Freeing...') obj.free() LOGGER.warning('Free done')