Skip to content

Commit

Permalink
check cdmver before getting period
Browse files Browse the repository at this point in the history
  • Loading branch information
atheurer committed Nov 14, 2024
1 parent 193965c commit c604b08
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/base
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ function extract_primary_periods() {
RUN_DIR=${1}
shift

cdmver=`cat $CRUCIBLE_HOME/subprojects/core/CommonDataModel/VERSION`

if [ -e ${RUN_DIR} -a -d ${RUN_DIR} ]; then
json_files=$(find -L "${RUN_DIR}" -name primary-period.json)
if [ -n "${json_files}" ]; then
Expand Down Expand Up @@ -411,9 +413,14 @@ function extract_primary_periods() {
if [ -z "${SAMPLE_NUM}" -o ${SAMPLE_RC} != 0 ]; then
SAMPLE_RC=1
else
PRIMARY_PERIOD_ID=$(${podman_run} --name crucible-extract-primary-periods-id-${SESSION_ID} "${container_common_args[@]}" "${container_rs_args[@]}" ${CRUCIBLE_CONTROLLER_IMAGE} /bin/bash -c "${result_dumper} ${json_file} | jq -r '. \"period\".\"id\"'")
if [ "$cdmver" == "v7dev" ]; then
PRIMARY_PERIOD_ID=$(${podman_run} --name crucible-extract-primary-periods-id-${SESSION_ID} "${container_common_args[@]}" "${container_rs_args[@]}" ${CRUCIBLE_CONTROLLER_IMAGE} /bin/bash -c "${result_dumper} ${json_file} | jq -r '. \"period\".\"id\"'")
elif [ "$cdmver" == "v8dev" ]; then
PRIMARY_PERIOD_ID=$(${podman_run} --name crucible-extract-primary-periods-id-${SESSION_ID} "${container_common_args[@]}" "${container_rs_args[@]}" ${CRUCIBLE_CONTROLLER_IMAGE} /bin/bash -c "${result_dumper} ${json_file} | jq -r '. \"period\".\"period-uuid\"'")
else
exit_error "CommonDataModel version ($cdmver) is not supported, exiting"
fi
PRIMARY_PERIOD_RC=$?

if [ -z "${PRIMARY_PERIOD_ID}" -o ${PRIMARY_PERIOD_RC} != 0 ]; then
SAMPLE_RC=1
fi
Expand Down

0 comments on commit c604b08

Please sign in to comment.