failed commands in prepare-node-script do not raise errors

Bug #2068935 reported by Andre Ruiz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Snap
New
Undecided
Unassigned

Bug Description

I just had a case where the prepare-node-script failed to install juju, but the exit status of the script was still 0 so the installation continued only to fail later during sunbeam commands.

This is not critical, as the sunbeam command exit error was very explicit about missing juju, but perhaps it could make this more obvious earlier.

11:51:17 + sudo snap install --channel 3.4/stable juju
11:52:03 error: unable to contact snap store
[...]
11:52:03 DEBUG: execute return code is 0

This is the return code for the whole script, not for the juju command.

It failed later:

11:52:04 + sunbeam cluster join --role compute --token <supressed-token>
11:52:05 > Checking for host configuration of minimum 4 core and 16G RAM ...
11:52:05 > Checking for presence of Juju ...
11:52:05 Error: Juju not detected: please install snap
11:52:06 DEBUG: execute return code is 1

Maybe a good idea is to set -e in this script so that any errors will terminate it, and handle instead the cases where it is not critical as exceptions.

Andre Ruiz (andre-ruiz)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.