summaryrefslogtreecommitdiffstats
path: root/config/utils
diff options
context:
space:
mode:
Diffstat (limited to 'config/utils')
-rwxr-xr-xconfig/utils/check-schema.sh7
-rwxr-xr-xconfig/utils/generate_config.py4
2 files changed, 6 insertions, 5 deletions
diff --git a/config/utils/check-schema.sh b/config/utils/check-schema.sh
index 0cdc6f29..041c0308 100755
--- a/config/utils/check-schema.sh
+++ b/config/utils/check-schema.sh
@@ -16,8 +16,9 @@ RC=0
SUMMARY+=";;PDF;IDF;\n"
while IFS= read -r lab_config; do
+ idf_config="$(dirname "${lab_config}")/idf-$(basename "${lab_config}")"
pdf_cmd="${VALIDATE_SCHEMA} -s ${PDF_SCHEMA} -y ${lab_config}"
- idf_cmd="${VALIDATE_SCHEMA} -s ${IDF_SCHEMA} -y ${lab_config/pod/idf-pod}"
+ idf_cmd="${VALIDATE_SCHEMA} -s ${IDF_SCHEMA} -y ${idf_config}"
echo "###################### ${lab_config} ######################"
pdf_out=$(${pdf_cmd} 2>&1 | sed 's|ENC\[PKCS.*\][\\n]*|opnfv|g')
if [ -z "${pdf_out}" ]; then
@@ -29,7 +30,7 @@ while IFS= read -r lab_config; do
echo "${pdf_out}"
echo "[PDF] [ERROR] ${pdf_cmd}"
fi
- if [ ! -f "${lab_config/pod/idf-pod}" ]; then
+ if [ ! -f "${idf_config}" ]; then
SUMMARY+="-;\n"
elif ${idf_cmd}; then
SUMMARY+="OK;\n"
@@ -40,7 +41,7 @@ while IFS= read -r lab_config; do
echo "[IDF] [ERROR] ${idf_cmd}"
fi
echo ''
-done < <(find 'labs' -name 'pod*.yaml')
+done < <(find 'labs' -name 'pod*.yaml' -or -name 'virtual*.yaml')
cat <<EOF
###################### Schema Validation Matrix ######################
diff --git a/config/utils/generate_config.py b/config/utils/generate_config.py
index 11d42caf..93e839bd 100755
--- a/config/utils/generate_config.py
+++ b/config/utils/generate_config.py
@@ -55,7 +55,7 @@ try:
DICT['details']
except (NameError, TypeError) as ex:
with open(ARGS.yaml) as _:
- DICT = yaml.load(_, Loader=LOADER)
+ DICT = yaml.load(_.read().replace('/', '__slash__'), Loader=LOADER)
# If an installer descriptor file (IDF) exists, include it (temporary)
IDF_PATH = '/idf-'.join(split(ARGS.yaml))
@@ -69,7 +69,7 @@ if exists(IDF_PATH):
for _j2 in ARGS.jinja2:
TEMPLATE = ENV.get_template(_j2)
- OUTPUT = TEMPLATE.render(conf=DICT)
+ OUTPUT = TEMPLATE.render(conf=DICT).replace('__slash__', '/')
# Render template and write generated conf to file or stdout
if ARGS.batch:
if _j2.endswith('.j2'):