Changeset 1065


Ignore:
Timestamp:
09/23/14 14:46:35 (10 years ago)
Author:
sdipsl
Message:
  • separate command and arguments when formating json message
  • fix #223 having proper json encoding for file list (array)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r1056 r1065  
    310310 
    311311    # Then, we shift StackArgs tabular 
     312    # Replacing blank separated list by comma separated list of quoted elements (except the first and last element) 
    312313    if [ $# -gt 1 ]; then 
    313       IGCM_debug_StackArgs[0]=$(echo ${INPUTS[*]:1} | sed -e "s/\ /,/g" ) 
     314      IGCM_debug_StackArgs[0]=$(echo ${INPUTS[*]:1} | sed -e "s/\ /\",\"/g" ) 
    314315    fi 
    315316 
     
    318319      code=2000 
    319320      # RabbitMQ message body 
    320       Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
     321      Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"{IGCM_debug_Stack[0]}\",\"arguments\":\[\"{IGCM_debug_StackArgs[0]}\"\],\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    321322      # Fill the rabbitMQ queue 
    322323      IGCM_debug_sendAMQP 
     
    513514        code=9000 
    514515        # RabbitMQ message body 
    515         Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
     516        Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    516517        # Fill the rabbitMQ queue 
    517518        IGCM_debug_sendAMQP 
     
    524525        code=3000 
    525526        # RabbitMQ message body 
    526         Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${INPUTS[*]}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
     527        Body=$( echo "{${genericSimulationID},\"msgCode\":\"${code}\",\"msgUID\":\"$(uuidgen)\",\"nesting\":\"${IGCM_debug_LenStack}\",\"command\":\"${command}\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    527528        # Fill the rabbitMQ queue 
    528529        IGCM_debug_sendAMQP 
     
    786787  if [ X${ActivateBigBro} = Xtrue ] ; then 
    787788    # RabbitMQ message body 
    788     Body=$( echo "{${genericSimulationID},${instrumentationContent},\"msgCode\":\"7000\",\"msgUID\":\"$(uuidgen)\",\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
     789    Body=$( echo "{${genericSimulationID},\"msgCode\":\"7000\",\"msgUID\":\"$(uuidgen)\",${instrumentationContent},\"msgTimestamp\":\"$( date +"%Y-%m-%dT%H:%M:%S.%N%z" )\"}" ) 
    789790    # Fill the rabbitMQ queue 
    790791    IGCM_debug_sendAMQP 
Note: See TracChangeset for help on using the changeset viewer.