Loading scripts/parse_tosca_definitions.sh +14 −12 Original line number Original line Diff line number Diff line Loading @@ -24,37 +24,39 @@ if [ ${TOSCA_PARSER} == "Cloudnet-TOSCA-toolbox" ] ; then CLOUDNET_BINDIR=../../bin CLOUDNET_BINDIR=../../bin . ${CLOUDNET_BINDIR}/cloudnet_rc.sh . ${CLOUDNET_BINDIR}/cloudnet_rc.sh res=0 finalResult=0 for i in *.yaml ; do for i in *.yaml ; do result=0 echo "Cloudnet-TOSCA-toolbox: Validating file $i..." >> debugCloudnet.log echo "Cloudnet-TOSCA-toolbox: Validating file $i..." >> debugCloudnet.log ../../bin/toscaware/toscaware $i &>> debugCloudnet.log ../../bin/toscaware/toscaware $i &> debug.log #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" -v "${PWD}/${TOSCA_PARSER_FOLDER}:/work" -v "${PWD}/${TOSCA_PARSER_FOLDER}/bin/cloudnet:/cloudnet" --workdir="/work" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$i" ${TOSCAWARE_OPTS} #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" -v "${PWD}/${TOSCA_PARSER_FOLDER}:/work" -v "${PWD}/${TOSCA_PARSER_FOLDER}/bin/cloudnet:/cloudnet" --workdir="/work" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$i" ${TOSCAWARE_OPTS} #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$1" ${TOSCAWARE_OPTS} #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$1" ${TOSCAWARE_OPTS} #./${TOSCA_PARSER_FOLDER}/bin/toscaware/toscaware $i $> debug.log #./${TOSCA_PARSER_FOLDER}/bin/toscaware/toscaware $i $> debug.log if [ $? == 2 ] ; then if [ $? == 2 ] ; then echo "Cloudnet-TOSCA-toolbox: ++++ Issues found with TOSCA file syntax in $i" echo "Cloudnet-TOSCA-toolbox: ++++ Issues found with TOSCA file syntax in $i" grep "ERROR" < debugCloudnet.log grep "ERROR" < debug.log res=1 finalResult=1 elif [ $? == 0 ] ; then else echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i" echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i" #Check the debug messages, if there's at least one ERROR then res=1 #Check the debug messages, if there's at least one ERROR then res=1 if [ `grep "ERROR" < debugCloudnet.log | wc -l` == 0 ] ; then if [ `grep "ERROR" < debug.log | wc -l` == 0 ] ; then echo "++++ TOSCA parser finished validation of $i with no errors" echo "++++ TOSCA parser finished validation of $i with no errors" else else echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i with errors" echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i with errors" grep "ERROR" < debugCloudnet.log grep "ERROR" < debug.log res = 1 finalResult=1 fi fi fi fi cat debug.log >> debugCloudnet.log done done cp debugCloudnet.log ../../../debugCloudnet.log cp debugCloudnet.log ../../../debugCloudnet.log elif [ ${TOSCA_PARSER} == "Puccini" ] ; then elif [ ${TOSCA_PARSER} == "Puccini" ] ; then res=0 finalResult=0 echo "Puccini: Validation starting ..." echo "Puccini: Validation starting ..." docker run --rm -v "${PWD}:/sol001" puccini ./sol001/scripts/puccini_parse.sh &> debugPuccini.log docker run --rm -v "${PWD}:/sol001" puccini ./sol001/scripts/puccini_parse.sh &> debugPuccini.log Loading @@ -69,9 +71,9 @@ elif [ ${TOSCA_PARSER} == "Puccini" ] ; then # grep "PROBLEMS" < debug.log # grep "PROBLEMS" < debug.log # res=1 # res=1 #fi #fi res=1 finalResult=1 fi fi fi fi exit $res exit $finalResult No newline at end of file No newline at end of file Loading
scripts/parse_tosca_definitions.sh +14 −12 Original line number Original line Diff line number Diff line Loading @@ -24,37 +24,39 @@ if [ ${TOSCA_PARSER} == "Cloudnet-TOSCA-toolbox" ] ; then CLOUDNET_BINDIR=../../bin CLOUDNET_BINDIR=../../bin . ${CLOUDNET_BINDIR}/cloudnet_rc.sh . ${CLOUDNET_BINDIR}/cloudnet_rc.sh res=0 finalResult=0 for i in *.yaml ; do for i in *.yaml ; do result=0 echo "Cloudnet-TOSCA-toolbox: Validating file $i..." >> debugCloudnet.log echo "Cloudnet-TOSCA-toolbox: Validating file $i..." >> debugCloudnet.log ../../bin/toscaware/toscaware $i &>> debugCloudnet.log ../../bin/toscaware/toscaware $i &> debug.log #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" -v "${PWD}/${TOSCA_PARSER_FOLDER}:/work" -v "${PWD}/${TOSCA_PARSER_FOLDER}/bin/cloudnet:/cloudnet" --workdir="/work" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$i" ${TOSCAWARE_OPTS} #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" -v "${PWD}/${TOSCA_PARSER_FOLDER}:/work" -v "${PWD}/${TOSCA_PARSER_FOLDER}/bin/cloudnet:/cloudnet" --workdir="/work" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$i" ${TOSCAWARE_OPTS} #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$1" ${TOSCAWARE_OPTS} #docker ${DOCKER_OPTS} run --user "$(id -u)":"$(id -g)" --rm --attach=stdin --attach=stdout --attach=stderr cloudnet/toscaware python ${PYTHON_OPTS} /cloudnet/tosca/tosca2cloudnet.py --template-file "$1" ${TOSCAWARE_OPTS} #./${TOSCA_PARSER_FOLDER}/bin/toscaware/toscaware $i $> debug.log #./${TOSCA_PARSER_FOLDER}/bin/toscaware/toscaware $i $> debug.log if [ $? == 2 ] ; then if [ $? == 2 ] ; then echo "Cloudnet-TOSCA-toolbox: ++++ Issues found with TOSCA file syntax in $i" echo "Cloudnet-TOSCA-toolbox: ++++ Issues found with TOSCA file syntax in $i" grep "ERROR" < debugCloudnet.log grep "ERROR" < debug.log res=1 finalResult=1 elif [ $? == 0 ] ; then else echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i" echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i" #Check the debug messages, if there's at least one ERROR then res=1 #Check the debug messages, if there's at least one ERROR then res=1 if [ `grep "ERROR" < debugCloudnet.log | wc -l` == 0 ] ; then if [ `grep "ERROR" < debug.log | wc -l` == 0 ] ; then echo "++++ TOSCA parser finished validation of $i with no errors" echo "++++ TOSCA parser finished validation of $i with no errors" else else echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i with errors" echo "Cloudnet-TOSCA-toolbox: ++++ TOSCA parser finished validation of $i with errors" grep "ERROR" < debugCloudnet.log grep "ERROR" < debug.log res = 1 finalResult=1 fi fi fi fi cat debug.log >> debugCloudnet.log done done cp debugCloudnet.log ../../../debugCloudnet.log cp debugCloudnet.log ../../../debugCloudnet.log elif [ ${TOSCA_PARSER} == "Puccini" ] ; then elif [ ${TOSCA_PARSER} == "Puccini" ] ; then res=0 finalResult=0 echo "Puccini: Validation starting ..." echo "Puccini: Validation starting ..." docker run --rm -v "${PWD}:/sol001" puccini ./sol001/scripts/puccini_parse.sh &> debugPuccini.log docker run --rm -v "${PWD}:/sol001" puccini ./sol001/scripts/puccini_parse.sh &> debugPuccini.log Loading @@ -69,9 +71,9 @@ elif [ ${TOSCA_PARSER} == "Puccini" ] ; then # grep "PROBLEMS" < debug.log # grep "PROBLEMS" < debug.log # res=1 # res=1 #fi #fi res=1 finalResult=1 fi fi fi fi exit $res exit $finalResult No newline at end of file No newline at end of file