def wrapped(*args, **kwargs): try: return fn(*args, **kwargs) except restkit_errors.Unauthorized as e: github_access.authorizeUser() logger.debug('trying with authtoken:', settings.getProperty('github', 'authtoken')) return fn(*args, **kwargs)
def wrapped(*args, **kwargs): try: return fn(*args, **kwargs) except requests.exceptions.HTTPError as e: if e.response.status_code == requests.codes.unauthorized: logger.debug('%s unauthorised', fn) github_access.authorizeUser() logger.debug('trying with authtoken: %s', settings.getProperty('github', 'authtoken')) return fn(*args, **kwargs) else: raise
def wrapped(*args, **kwargs): try: return fn(*args, **kwargs) except requests.exceptions.HTTPError as e: if e.response.status_code == requests.codes.unauthorized: github_access.authorizeUser() logger.debug('trying with authtoken:', settings.getProperty('github', 'authtoken')) return fn(*args, **kwargs) else: raise
def wrapped(*args, **kwargs): try: return fn(*args, **kwargs) except requests.exceptions.HTTPError as e: if e.response.status_code == requests.codes.unauthorized: logger.debug('%s unauthorised', fn) # any provider is sufficient for registry auth github_access.authorizeUser(provider=None) logger.debug('retrying after authentication...') return fn(*args, **kwargs) else: raise