[openstack-dev] Catching shell scripting errors

Dmitry Bilunov dbilunov at mirantis.com
Tue Jan 26 10:09:07 UTC 2016


Hello.

Recently we had a typo[1], which caused BVT random failures. We have a script
setting up mcollective configuration file that is called
(sequentially) from rc.local
after another script, which makes sure that network interfaces are named in an
expected way.
This typo rendered the renaming procedure slow, leaving mcollective
unconfigured for
a while. Depending on random events, these events made tests to fail without
exposing the root cause in the logs, so it took much time to deal with it.

We can possibly avoid such situations by declaring "set -eu" in our
bash scripts.
It raises two issues:
1. set -u is a bashism;
2. scripts need to be refactored to work with set -eu.

[1] https://review.openstack.org/#/c/271748/1/contrib/fuel_bootstrap/files/trusty/usr/share/initramfs-tools/hooks/netifnames



More information about the OpenStack-dev mailing list