devstack: remove bionic condition to install appamor related pkgs

In this commit we remove the unecessary condition that restricts the
install of appamor related packages to Bionic. We replace it with a
mechanism which will install them if necessary. This will avoid any
revisiting of this file for ubuntu based versions that do not provide
them.

Change-Id: Ie2766b0c742b2c4416947bb77050992a51034568
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
This commit is contained in:
Sahid Orentino Ferdjaoui 2019-04-03 13:54:18 +00:00
parent e2aab580bd
commit 053f02fb27
1 changed files with 9 additions and 6 deletions

View File

@ -40,12 +40,15 @@ function pre_install_nova-lxd() {
add_user_to_group $STACK_USER $LXD_GROUP
if [ "$DISTRO" == "bionic" ]; then
# install apparmor on the devstack image and restart lxd daemon
# the devstack-gate image that is built lacks apparmor, but LXD
# requires apparmor to work, so we add it back into the image.
sudo apt install -y apparmor apparmor-profiles-extra apparmor-utils
sudo systemctl restart lxd.service
needs_restart=false
is_package_installed apparmor || \
install_package apparmor && needs_restart=true
is_package_installed apparmor-profiles-extra || \
install_package apparmor-profiles-extra && needs_restart=true
is_package_installed apparmor-utils || \
install_package apparmor-utils && needs_restart=true
if $needs_restart; then
restart_service lxd
fi
fi
}