@@ -631,27 +631,31 @@ diff_model() {
631631 local JAVA_PROPS=" -Dpython.console= ${JAVA_PROPS} -Djava.security.egd=file:/dev/./urandom"
632632 local CP=${ORACLE_SERVER_DIR} /server/lib/weblogic.jar
633633 # Get partial models for sanity check for forbidden attribute change
634- local SERVER_OR_SERVERTEMPLATES_NAMES=$( jq ' { topology: { Server: (.topology.Server | with_entries(.value = {})),
634+ local SERVER_OR_SERVERTEMPLATES_NAMES
635+ SERVER_OR_SERVERTEMPLATES_NAMES=$( jq ' { topology: { Server: (.topology.Server | with_entries(.value = {})),
635636 ServerTemplate: (if .topology.ServerTemplate then (.topology.ServerTemplate | with_entries(.value = {})) else empty end)
636637 }} | if .topology.ServerTemplate == {} then del(.topology.ServerTemplate) else . end' $2 )
637638 rc=$?
638639 if [ $rc -ne 0 ] ; then
639640 trace SEVERE " Failed to extract server names from original model using jq " $rc
640641 exitOrLoop
641642 fi
642- local PARTIAL_DIFFED_MODEL=$( jq ' {domainInfo: .domainInfo, topology: .topology} | with_entries(select(.value != null))' /tmp/diffed_model.json)
643- rc=$?
644- if [ $rc -ne 0 ] ; then
645- trace SEVERE " Failed to extract domainInfo and topology from delta model using jq " $rc
646- exitOrLoop
643+ local PARTIAL_DIFFED_MODEL
644+ if [ -f /tmp/diffed_model.json ] ; then
645+ PARTIAL_DIFFED_MODEL=$( jq ' {domainInfo: .domainInfo, topology: .topology} | with_entries(select(.value != null))' /tmp/diffed_model.json)
646+ rc=$?
647+ if [ $rc -ne 0 ] ; then
648+ trace SEVERE " Failed to extract domainInfo and topology from delta model using jq " $rc
649+ exitOrLoop
650+ fi
651+ else
652+ PARTIAL_DIFFED_MODEL=" {}"
647653 fi
648-
649- ${JAVA_HOME} /bin/java -cp ${CP} \
650- ${JAVA_PROPS} \
651- org.python.util.jython \
652- ${SCRIPTPATH} /model-diff.py " $SERVER_OR_SERVERTEMPLATES_NAMES " " $PARTIAL_DIFFED_MODEL " > ${WDT_OUTPUT} 2>&1
654+ # Use the real wlst.sh and not the operator wrap script, calling jypthon directory has problem understanding WLST boolean false, true etc..
655+ # eval will fail
656+ ${ORACLE_HOME} /oracle_common/common/bin/wlst.sh ${SCRIPTPATH} /model-diff.py " ${SERVER_OR_SERVERTEMPLATES_NAMES} " " ${PARTIAL_DIFFED_MODEL} " > ${WDT_OUTPUT} 2>&1
653657 if [ $? -ne 0 ] ; then
654- trace SEVERE " Failed to compare models. Error output:"
658+ trace SEVERE " Failed to interpret models results . Error output:"
655659 cat ${WDT_OUTPUT}
656660 exitOrLoop
657661 fi
0 commit comments