Commit 56449dc0 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Device - gNMI OpenConfig Driver:

- Refining code
parent 75078625
Loading
Loading
Loading
Loading
+27 −5
Original line number Original line Diff line number Diff line
@@ -92,12 +92,34 @@ class InterfaceHandler(_Handler):
            LOGGER.warning('Getting...')
            LOGGER.warning('Getting...')
            try:
            try:
                obj = objects_to_free.get_nowait()
                obj = objects_to_free.get_nowait()
                LOGGER.warning('Releasing: {:s}'.format(str(obj)))
                if obj is None:
                if obj is None: continue
                    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(
                    LOGGER.warning('Releasing: {:s} => {:s}'.format(
                        str(obj.path()), str(obj.print_mem('json'))
                        str(obj.path()), str(obj.print_mem('json'))
                    ))
                    ))
                try:
                    LOGGER.warning('Freeing...')
                    LOGGER.warning('Freeing...')
                    obj.free()
                    obj.free()
                    LOGGER.warning('Free done')
                    LOGGER.warning('Free done')