

def validate_formula_components(components, versions):
    '\n    Validate a LIST of formula components, where the versions DO NOT already exist\n    i.e. creating a blueprint\n    '
    version_map = {
        
    }
    for version in versions:
        version_map[version['formula']] = version['version']
    errors = {
        
    }
    for component in components:
        validated = component.pop('validated', False)
        formula = component.get('formula')
        if (not validated):
            sls_path = component['sls_path']
            version = version_map.get(formula)
            component_list = formula.components_for_version(version)
            if (sls_path not in component_list):
                err_msg = 'formula `{0}` does not contain an sls_path called `{1}`.'
                errors.setdefault('sls_path', []).append(err_msg.format(formula.uri, sls_path))
    if errors:
        raise ValidationError(errors)
    return components

dataset/ETHPy150Open stackdio/stackdio/stackdio/api/formulas/validators.py validate_formula_components/original