from typing import Union


def node_name_in_list(name: str, slots: list) -> Union[int, None]:
    """Check if a node name is already in a list of slots."""
    try:
        return [slot['UtsnameNodename'] for slot in slots].index(name)
    except ValueError:
        return None