def verify_user_noroles(self,username): status, content, header=rbacmain(self.master)._retrieve_user_roles() res = json.loads(content) userExist=False for ele in res: log.debug("user {0}".format(ele["name"])) log.debug(ele["name"] == username) if ele["name"] == username: log.debug("user roles {0}".format(ele["roles"])) if not ele["roles"]: log.info("user {0} has no roles".format(username)) userExist=True break if not userExist: raise Exception("user {0} roles are not empty".format(username))
def verify_user_noroles(self, username): status, content, header = rbacmain(self.master)._retrieve_user_roles() res = json.loads(content) userExist = False for ele in res: log.debug("user {0}".format(ele["name"])) log.debug(ele["name"] == username) if ele["name"] == username: log.debug("user roles {0}".format(ele["roles"])) if not ele["roles"]: log.info("user {0} has no roles".format(username)) userExist = True break if not userExist: raise Exception("user {0} roles are not empty".format(username))