fi
# Add custom logging levels
- # CONTROLLERDEBUGMAP is expected to be a key:value map of space separated values like "module:level module2:level2"
- # where module is abbreviated and does not include "org.opendaylight."
+ # CONTROLLERDEBUGMAP is expected to be a key:value map of space separated
+ # values like "module:level module2:level2" where module is abbreviated and
+ # does not include "org.opendaylight."
unset IFS
echo "controllerdebugmap: ${controllerdebugmap}"
if [ -n "${controllerdebugmap}" ]; then
cat ${LOGCONF}
} # function configure_karaf_log()
+function configure_karaf_log_for_apex() {
+ # TODO: add the extra steps to this function to do any extra work
+ # in this apex environment like we do in our standard environment.
+ # EX: log size, rollover, etc.
+
+ # Modify ODL Log Levels, if needed, for new distribution. This will modify
+ # the control nodes hiera data which will be used during the puppet deploy
+ # CONTROLLERDEBUGMAP is expected to be a key:value map of space separated
+ # values like "module:level module2:level2" where module is abbreviated and
+ # does not include "org.opendaylight."
+
+ local -r controller_ip=$1
+
+ unset IFS
+ # shellcheck disable=SC2153
+ echo "CONTROLLERDEBUGMAP: ${CONTROLLERDEBUGMAP}"
+ if [ -n "${CONTROLLERDEBUGMAP}" ]; then
+ logging_config='\"opendaylight::log_levels\": {'
+ for kv in ${CONTROLLERDEBUGMAP}; do
+ module="${kv%%:*}"
+ level="${kv#*:}"
+ echo "module: $module, level: $level"
+ # shellcheck disable=SC2157
+ if [ -n "${module}" ] && [ -n "${level}" ]; then
+ orgmodule="org.opendaylight.${module}"
+ logging_config="${logging_config} \\\"${orgmodule}\\\": \\\"${level}\\\","
+ fi
+ done
+ # replace the trailing comma with a closing brace followed by trailing comma
+ logging_config=${logging_config%,}" },"
+ echo $logging_config
+
+ # fine a sane line number to inject the custom logging json
+ lineno=$(ssh $OPENSTACK_CONTROL_NODE_1_IP "sudo grep -Fn 'opendaylight::log_mechanism' /etc/puppet/hieradata/service_configs.json" | awk -F: '{print $1}')
+ ssh $controller_ip "sudo sed -i \"${lineno}i ${logging_config}\" /etc/puppet/hieradata/service_configs.json"
+ ssh $controller_ip "sudo cat /etc/puppet/hieradata/service_configs.json"
+ fi
+} # function configure_karaf_log_for_apex()
+
function get_os_deploy() {
local -r num_systems=${1:-$NUM_OPENSTACK_SYSTEM}
case ${num_systems} in