X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=descriptor-packages%2Ftools%2Fgenerate_descriptor_pkg.sh;h=1b9a9e03fd9c9f6adea38c73074b56d78d680861;hb=c5a51c40540ea2b0bb888c98c8441a551b084d8f;hp=5ee4d2a9a38d5f17e7ef79daa120fa6c132cf0a2;hpb=4d2bc6c49da35f19d0eee3dc5c2abd62dbc60e56;p=osm%2Fdevops.git diff --git a/descriptor-packages/tools/generate_descriptor_pkg.sh b/descriptor-packages/tools/generate_descriptor_pkg.sh index 5ee4d2a9..1b9a9e03 100755 --- a/descriptor-packages/tools/generate_descriptor_pkg.sh +++ b/descriptor-packages/tools/generate_descriptor_pkg.sh @@ -47,6 +47,7 @@ NSD_FOLDERS=(scripts charms icons ns_config vnf_config) # Other files allowed in the descriptor base directory ALLOWED_FILES=(README) +ALLOWED_FILES_WILDCARDS=(README) DESC_TYPES=(vnfd nsd) DESC_EXTN=(yml yaml json xml) @@ -756,7 +757,11 @@ if [ $CREATE == false ]; then for f in ${files[@]}; do if [ $(contains "${ALLOWED_FILES[@]}" $f) == "n" ]; then - echo "WARN: Unsupported file $f found" + for j in ${ALLOWED_FILES_WILDCARDS[@]}; do + if [[ $f != *"$j"* ]]; then + echo "WARN: Unsupported file $f found" + fi + done fi done @@ -790,6 +795,14 @@ if [ $CREATE == false ]; then fi cd $BASE_DIR + # Mrityunjay Yadav: Validate descriptor + GEN_BASEDIR=$(dirname "$0") + python3 $GEN_BASEDIR/validate_descriptor.py $BASE_DIR/$PKG/$descriptor + if [ $? -ne 0 ]; then + rc=$? + echo "ERROR: validating descriptor for $PKG ($rc)" >&2 + exit $rc + fi if [ $DRY_RUN == false ]; then if [ $VERBOSE == true ]; then tar zcvf "$DEST_DIR/$PKG.tar.gz" "${PKG}" ${RM}