def parse_host_components(components):
    """Parse a component list as given in an environment config for a host
    into a dict of dicts:

        {'name': {'features': [], 'ignore': False}}

    If one component is ignored, then the whole set of component features
    is ignored.

    Expected syntax:

    [!]component[:feature], component[:feature]

    """
    result = {}
    for name in components:
        name = name.strip()
        if ":" in name:
            name, feature = name.split(":", 1)
        else:
            feature = None

        ignore = name.startswith("!")
        name = name.lstrip("!")
        result.setdefault(name, {"features": [], "ignore": False})
        result[name]["ignore"] |= ignore
        if feature:
            result[name]["features"].append(feature)
    return result