Commit ad40364f authored by Benziane Chakib's avatar Benziane Chakib
Browse files

Bug fix to authentication process on node

parent 6ba6ac15
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -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:
            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