Comment 3 for bug 1253198

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

In the referenced job the failure is not detected because in usr/local/bin/run-autopilot.sh (from container ps-radeon-hd8350:/var/lib/lxc/trusty-amd64-20131023-0529/) in install_debs() apt is called with:

66 echo "Package list: ${package_list}" >> $AP_SETUP_LOGFILE
67 sudo apt-get -y --force-yes install $package_list >> $AP_SETUP_LOGFILE

and there is no error handling

You should do something like this instead
rc=0
sudo apt-get -y --force-yes install $package_list||rc=$? >> $AP_SETUP_LOGFILE
if [ $rc -gt 0 ]; then
    # Terminate gracefully
   ...