Skip to content
Snippets Groups Projects
Commit ad40364f authored by Benziane Chakib's avatar Benziane Chakib
Browse files

Bug fix to authentication process on node

parent 6ba6ac15
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,16 @@ class CCNode(object):
logging.debug('Authenticating user %s with password <%s>' % (login,
password))
try:
#TODO: authentify returns role
role = self.server.authentify(login, password)
except RpcError as err:
logging.warning('Authentication error')
if err.exception == 'AuthenticationError':
logging.warning('Authentication error')
else:
logging.warning('Unknown error while authenticating: %s' % err)
return False
else:
if role is not 'hypervisor':
logging.warning('Bad role affected by server: %s' % role)
return False
else:
return True
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment