Exemple #1
0
    def users(self):
        """Get a list of users in this cluster.

        Unlike volumes, user emails are not prefixed with cluster name.
        """
        all_users = api.listUsers()
        users = [User(self, email, data) for email, data in all_users.items()]
        return sorted(users, key=lambda u: (u.is_reserved, u.email))
def validate_email(email):
    email = email.lower()
    for user_email in api.listUsers().keys():
        if email == user_email.lower():
            return False, "Username not available"
    return True, None