Browse code

Support for logging the nova-dhcpbridge command line

We are seeing a lot of gate failures as vm(s) are unable to acquire
DHCP leases:
https://bugs.launchpad.net/nova/+bug/1532809

we need to set log_file for nova-dhcpbridge configuration, so clone
the nova.conf and set the log_file properly to a path where the
CI can pick up from for analysis.

Change-Id: Iec4fe3f2235da9d1f5bd399d4ffc45af516c58ce
(cherry picked from commit ac8ff0f1e9e5116c390bf8a711c950bcaca71d32)
(cherry picked from commit bd7a51200f3a3c11ca5f18f0b7f95ee9049e1e40)

Davanum Srinivas authored on 2016/01/14 07:28:43
Showing 1 changed files
... ...
@@ -652,6 +652,23 @@ function create_nova_conf {
652 652
         iniset $NOVA_CONF serial_console serialproxy_host "$NOVA_SERVICE_LISTEN_ADDRESS"
653 653
         iniset $NOVA_CONF serial_console enabled True
654 654
     fi
655
+
656
+    # Setup logging for nova-dhcpbridge command line
657
+    sudo cp "$NOVA_CONF" "$NOVA_CONF_DIR/nova-dhcpbridge.conf"
658
+
659
+    local service="n-dhcp"
660
+    local logfile="${service}.log.${CURRENT_LOG_TIME}"
661
+    local real_logfile="${LOGDIR}/${logfile}"
662
+    if [[ -n ${LOGDIR} ]]; then
663
+        bash -c "cd '$LOGDIR' && ln -sf '$logfile' ${service}.log"
664
+        iniset "$NOVA_CONF_DIR/nova-dhcpbridge.conf" DEFAULT log_file "$real_logfile"
665
+        if [[ -n ${SCREEN_LOGDIR} ]]; then
666
+            # Drop the backward-compat symlink
667
+            ln -sf "$real_logfile" ${SCREEN_LOGDIR}/screen-${service}.log
668
+        fi
669
+    fi
670
+
671
+    iniset $NOVA_CONF DEFAULT dhcpbridge_flagfile "$NOVA_CONF_DIR/nova-dhcpbridge.conf"
655 672
 }
656 673
 
657 674
 function init_nova_cells {