Theo Chatzimichos 80f9bb
#!/bin/bash
Theo Chatzimichos 80f9bb
Theo Chatzimichos 298cab
NON_SLS_PILLAR=$(find pillar -type f | egrep -v "(macros.jinja|(FORMULAS|valid_custom_grains)\.yaml|\.sls)$")
Theo Chatzimichos 298cab
NON_SLS_SALT=$(find salt -type f | egrep -v "/(files|templates)/|(pillar\.example|\.sls)$")
Theo Chatzimichos 80f9bb
NON_SLS=( ${NON_SLS_PILLAR} ${NON_SLS_SALT} )
Theo Chatzimichos 80f9bb
Theo Chatzimichos 80f9bb
if [[ -n $NON_SLS ]]; then
Theo Chatzimichos 80f9bb
    echo "The following files are missing the .sls extension:"
Theo Chatzimichos 80f9bb
    for file in ${NON_SLS[@]}; do
Theo Chatzimichos 80f9bb
        echo ${file}
Theo Chatzimichos 80f9bb
    done
Theo Chatzimichos 80f9bb
    exit 1
Theo Chatzimichos 80f9bb
fi