@@ -631,27 +631,31 @@ diff_model() {
631
631
local JAVA_PROPS=" -Dpython.console= ${JAVA_PROPS} -Djava.security.egd=file:/dev/./urandom"
632
632
local CP=${ORACLE_SERVER_DIR} /server/lib/weblogic.jar
633
633
# 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 = {})),
635
636
ServerTemplate: (if .topology.ServerTemplate then (.topology.ServerTemplate | with_entries(.value = {})) else empty end)
636
637
}} | if .topology.ServerTemplate == {} then del(.topology.ServerTemplate) else . end' $2 )
637
638
rc=$?
638
639
if [ $rc -ne 0 ] ; then
639
640
trace SEVERE " Failed to extract server names from original model using jq " $rc
640
641
exitOrLoop
641
642
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=" {}"
647
653
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
653
657
if [ $? -ne 0 ] ; then
654
- trace SEVERE " Failed to compare models. Error output:"
658
+ trace SEVERE " Failed to interpret models results . Error output:"
655
659
cat ${WDT_OUTPUT}
656
660
exitOrLoop
657
661
fi
0 commit comments