diff options
author | 2018-01-30 22:32:46 +0000 | |
---|---|---|
committer | 2018-01-30 22:32:46 +0000 | |
commit | 48b9aa5af10deebcda256d74681b1c56f516adc9 (patch) | |
tree | a59d7d12d0699138cacdf2f31cfd1f2ed80fa726 /config/utils | |
parent | ce5cd10b7ce6714124dcdbfc76365ae0854f9146 (diff) | |
parent | 42415daa0a9ca2d2d52620f46b9edb3f8f7b1da5 (diff) |
Merge changes from topics 'fuel-netmap', 'fix-check-jinja'
* changes:
[fuel] Add net_map.j2 for net config abstraction
[fuel] Explicitly blacklist incompatible labs
[IDF] Add optional 'idf.installer' array
Diffstat (limited to 'config/utils')
-rwxr-xr-x | config/utils/check-jinja2.sh | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/config/utils/check-jinja2.sh b/config/utils/check-jinja2.sh index b7fa5912..16e52130 100755 --- a/config/utils/check-jinja2.sh +++ b/config/utils/check-jinja2.sh @@ -35,27 +35,19 @@ done # shellcheck disable=SC2086 while IFS= read -r lab_config; do SUMMARY+="\n${lab_config#labs/};" - lab_nodes=$(grep -ce 'node:' "${lab_config}") - lab_tmacs=$(grep -ce 'mac_address:' "${lab_config}") - ((lab_amacs=lab_tmacs/lab_nodes)); ((lab_nodes-=1)) + idf_config="$(dirname "${lab_config}")/idf-$(basename "${lab_config}")" + idf_installer=$(grep 'installer:' "${idf_config}" 2>/dev/null || echo) echo "###################### ${lab_config} ######################" for adapter in ${INSTALLER_ADAPTERS}; do pdf_inst=0 pdf_inst_pass=0 pdf_yaml_pass=0 - ia_nodes=$(grep -hPo 'nodes\W+\K\d+' -R "${adapter}" | tail -1) - ia_rmacs=$(grep -hPo 'interfaces\W+\K\d+' -R "${adapter}" | sort | tail -1) - ((ia_nodes+=1)); ((ia_rmacs+=1)) - if [[ ${ia_nodes} -gt ${lab_nodes} ]]; then + installer_name=$(basename "${adapter}") + if [ -n "${idf_installer}" ] && echo "${idf_installer}" | \ + grep -vq "${installer_name}"; then SUMMARY+='-;' - echo -n "[GENERATE] [SKIP] $(basename "${adapter}") requires at least" - echo -e " ${ia_nodes} nodes, but found only ${lab_nodes}, skipping.\n" - continue - fi - if [[ ${ia_rmacs} -ge ${lab_amacs} ]]; then - SUMMARY+='-;' - echo -n "[GENERATE] [SKIP] $(basename "${adapter}") requires at least" - echo -e " ${ia_rmacs} nics, but found ~ ${lab_amacs}, skipping.\n" + echo -n "[GENERATE] [SKIP] idf.installer defined and " + echo -e "${installer_name} not listed, skipping.\n" continue fi while IFS= read -r jinja_template; do |