tools/validate_descriptor.py reconverted as python3 script
[osm/devops.git] / descriptor-packages / tools / generate_descriptor_pkg.sh
index e14d412..1b9a9e0 100755 (executable)
@@ -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
 
@@ -792,7 +797,7 @@ if [ $CREATE == false ]; then
     cd $BASE_DIR
     # Mrityunjay Yadav: Validate descriptor
     GEN_BASEDIR=$(dirname "$0")
-    python $GEN_BASEDIR/validate_descriptor.py $BASE_DIR/$PKG/$descriptor
+    python3 $GEN_BASEDIR/validate_descriptor.py $BASE_DIR/$PKG/$descriptor
     if [ $? -ne 0 ]; then
         rc=$?
         echo "ERROR: validating descriptor for $PKG ($rc)" >&2