ssh: prevent exceptions when user associated to stored old key is not found.
This commit is contained in:
parent
8686845a97
commit
82baccf66d
2 changed files with 8 additions and 2 deletions
|
|
@ -180,6 +180,11 @@ class SshWrapper(object):
|
|||
|
||||
elif scm_detected:
|
||||
user = User.get(user_id)
|
||||
if not user:
|
||||
log.warning('User with id %s not found', user_id)
|
||||
exit_code = -1
|
||||
return exit_code
|
||||
|
||||
auth_user = user.AuthUser()
|
||||
permissions = auth_user.permissions['repositories']
|
||||
|
||||
|
|
|
|||
|
|
@ -83,8 +83,9 @@ class VcsServer(object):
|
|||
self.user, self.repo_name)
|
||||
return 0
|
||||
|
||||
log.error('Cannot properly fetch or allow user permissions. '
|
||||
'Return value is: %s, req action: %s', permission, action)
|
||||
log.error('Cannot properly fetch or allow user %s permissions. '
|
||||
'Return value is: %s, req action: %s',
|
||||
self.user, permission, action)
|
||||
return -2
|
||||
|
||||
def update_environment(self, action, extras=None):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue