Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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
Exemplo n.º 3
0
 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
Exemplo n.º 4
0
 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
Exemplo n.º 5
0
 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