From: Adam Israel Date: Wed, 21 Nov 2018 21:47:45 +0000 (-0500) Subject: (bug 578) Fix installer on Ubuntu 18.04 X-Git-Tag: v5.0.0~13^2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=8232e569c6c4f7b42adb3e2cd007d135c5dde459;p=osm%2Fdevops.git (bug 578) Fix installer on Ubuntu 18.04 We originally ran into this at the hackfest, where the installer would fail on Ubuntu 18.04, the latest long-term supported release. The behaviour of the `sg` command has failed (an apparent upstream change) so that it can't be reliably used to check the error code of the command it runs. Considering the original use of `sg`, to ensure that the user had access to lxd in order to bootstrap, reduces how we use `sg`, only calling it if we need to bootstrap a new juju controller. The other commands -- `juju show-controller` and `juju controllers` -- do not need access to the lxd group in order to function. I've tested this patch on Ubuntu 16.04 and 18.04 and verified that it works as expected on both (where lxd now pre-installed) and will also work with older versions of 16.04 that may not have it installed. Signed-off-by: Adam Israel Change-Id: I0e50ef3ac3cf127b63f5f56d8f90fea44f5be0f2 --- diff --git a/installers/full_install_osm.sh b/installers/full_install_osm.sh index f67ba082..042c98b3 100755 --- a/installers/full_install_osm.sh +++ b/installers/full_install_osm.sh @@ -83,7 +83,7 @@ function uninstall(){ } # takes a juju/accounts.yaml file and returns the password specific -# for a controller. I wrote this using only bash tools to minimize +# for a controller. I wrote this using only bash tools to minimize # additions of other packages function parse_juju_password { password_file="${HOME}/.local/share/juju/accounts.yaml" @@ -632,11 +632,11 @@ function install_juju() { } function juju_createcontroller() { - if ! sg lxd -c "juju show-controller $OSM_STACK_NAME &> /dev/null"; then + if ! juju show-controller $OSM_STACK_NAME &> /dev/null; then # Not found created, create the controller sg lxd -c "juju bootstrap --bootstrap-series=xenial localhost $OSM_STACK_NAME" fi - [ $(sg lxd -c "juju controllers" | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed" + [ $(juju controllers | awk "/^${OSM_STACK_NAME}[\*| ]/{print $1}"|wc -l) -eq 1 ] || FATAL "Juju installation failed" } function generate_docker_images() { @@ -1382,4 +1382,3 @@ fi wget -q -O- https://osm-download.etsi.org/ftp/osm-4.0-four/README2.txt &> /dev/null track end echo -e "\nDONE" -