def call_with_retry(out, retry, retry_wait, method, *args, **kwargs):
    for counter in range(retry):
        try:
            return method(*args, **kwargs)
        except NotFoundException:
            raise
        except ConanException as exc:
            if (counter == (retry - 1)):
                raise
            else:
                if out:
                    out.error(exc)
                    out.info(('Waiting %d seconds to retry...' % retry_wait))
                time.sleep(retry_wait)
def call_with_retry(out, retry, retry_wait, method, *args, **kwargs):
    for counter in range(retry):
        try:
            return method(*args, **kwargs)
        except NotFoundException:
            raise
        except ConanException as exc:
            if (counter == (retry - 1)):
                raise
            else:
                if out:
                    out.error(exc)
                    out.info(('Waiting %d seconds to retry...' % retry_wait))
                time.sleep(retry_wait)