Restore tracing on exit points of block_device_create_config_file

We exit in several places and don't restore tracing.  Previously in
nodepool we relied on the default fallback, which did restore the
tracing.  Since we now use the MBR config file, we take the different
exit path without it and the debugging output is incomplete.

Change-Id: I586fc95517926025705ce376ec5c4aaf4122773f
This commit is contained in:
Ian Wienand 2018-04-03 14:33:09 +10:00
parent 09e5b2d357
commit 855ab0d850

View File

@ -437,11 +437,13 @@ function block_device_create_config_file {
if [[ ${DIB_BLOCK_DEVICE_CONFIG:-} == file://* ]]; then
cp $(echo ${DIB_BLOCK_DEVICE_CONFIG} | cut -c 8-) ${config_yaml}
echo "Using file-based block-device config: ${DIB_BLOCK_DEVICE_CONFIG}"
$xtrace
return
fi
if [ -n "${DIB_BLOCK_DEVICE_CONFIG:-}" ]; then
printf "%s" "${DIB_BLOCK_DEVICE_CONFIG}" >${config_yaml}
echo "User specified block-device config from DIB_BLOCK_DEVICE_CONFIG"
$xtrace
return
fi
@ -463,12 +465,14 @@ function block_device_create_config_file {
if [ -e ${cfg} ]; then
cp ${cfg} ${config_yaml}
echo "Using block-device config: ${cfg}"
$xtrace
return
else
cfg=${image_elements[$i]}/block-device-default.yaml
if [ -e ${cfg} ]; then
cp ${cfg} ${config_yaml}
echo "Using block-device config: ${cfg}"
$xtrace
return
fi
fi