util/requests.py
def auth_retry(fail_msg):
    """
    Decorator for REST calls with auth retry
    :param fail_msg: Message to show on fail
    :return: Wrapped function
    """
    def wrap_func(func):
        def retry_func(*args, retry=True, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                if retry:
                    auth()
                    return retry_func(*args, retry=False, **kwargs)
                else:
                    util.utils.log(fail_msg, level=2)
                    util.utils.log(e, level=2)
        return retry_func
    return wrap_func

    Decorator for REST calls with auth retry
    :param fail_msg: Message to show on fail
    :return: Wrapped function
    
Decorator for REST calls with auth retry
Decorator for REST calls with auth retry
def auth_retry(fail_msg):
    def wrap_func(func):
        def retry_func(*args, retry=True, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                if retry:
                    auth()
                    return retry_func(*args, retry=False, **kwargs)
                else:
                    util.utils.log(fail_msg, level=2)
                    util.utils.log(e, level=2)
        return retry_func
    return wrap_func
def auth_retry ( fail_msg ) : def wrap_func ( func ) : def retry_func ( * args , retry = True , ** kwargs ) : try : return func ( * args , ** kwargs ) except Exception as e : if retry : auth ( ) return retry_func ( * args , retry = False , ** kwargs ) else : util . utils . log ( fail_msg , level = 2 ) util . utils . log ( e , level = 2 ) return retry_func return wrap_func
Decorator for REST calls with auth retry
Decorator for REST calls with auth retry
"""
    Decorator for REST calls with auth retry
    :param fail_msg: Message to show on fail
    :return: Wrapped function
    """
None
fail_msg
Message to show on fail
Message to show on fail