def raise_if_runroot_key_invalid(runroot_key):
    """
    Raise an ValueError exception in case the `runroot_key` contains forbidden
    characters.
    """
    for c in runroot_key:
        if c != '-' and not c.isalnum():
            raise ValueError(
                'Unexpected character \'%s\' in the runroot key "%s".' % (c,
                runroot_key))
