Example #1
0
def create(id, password):
    """Create a new user in the Bakula IAM

    Args:
        id: The new user's ID
        password: The new user's password

    Returns:
        True if created
    """
    try:
        User.get(User.id == id)
        return False
    except User.DoesNotExist:
        User.create(id=id, password=bcrypt.hashpw(password, bcrypt.gensalt()))
        return True
Example #2
0
def create(id, password):
    """Create a new user in the Bakula IAM

    Args:
        id: The new user's ID
        password: The new user's password

    Returns:
        True if created
    """
    try:
        User.get(User.id == id)
        return False
    except User.DoesNotExist:
        User.create(id=id, password=bcrypt.hashpw(password, bcrypt.gensalt()))
        return True