[openstack-dev] Catching shell scripting errors

Alexander Kostrikov akostrikov at mirantis.com
Wed Jan 27 15:16:56 UTC 2016

Hi, Dmitry.
I also would like to add `set -o pipefail` to the list as in a fantastic
Youtube talk  'The Functional Tao of Bash - Garrett Smith'[0].

[0] https://www.youtube.com/watch?v=yD2ekOEP9sU

On Tue, Jan 26, 2016 at 1:09 PM, Dmitry Bilunov <dbilunov at mirantis.com>

> 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
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Kind Regards,

Alexandr Kostrikov,

Mirantis, Inc.

35b/3, Vorontsovskaya St., 109147, Moscow, Russia

Tel.: +7 (495) 640-49-04
Tel.: +7 (925) 716-64-52 <%2B7%20%28906%29%20740-64-79>

Skype: akostrikov_mirantis

E-mail: akostrikov at mirantis.com <elogutova at mirantis.com>

*www.mirantis.com <http://www.mirantis.ru/>*
*www.mirantis.ru <http://www.mirantis.ru/>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160127/0289aec5/attachment.html>

More information about the OpenStack-dev mailing list