Add is_fedora and exit_distro_not_supported functions
Between is_fedora, is_ubuntu and is_suse, we can make the code a bit
simpler to read. We also use exit_distro_not_supported to identify
places where we need implementation details for new distros.
As "/sbin/service --skip-redirect" is Fedora-specific, guard this with a
is_fedora test too.
Change-Id: Ic77c0697ed9be0dbb5df8e73da93463e76025f0c
diff --git a/lib/nova b/lib/nova
index 3a4d34d..8272ef0 100644
--- a/lib/nova
+++ b/lib/nova
@@ -394,11 +394,13 @@
function install_nova() {
if is_service_enabled n-cpu; then
if is_ubuntu; then
- LIBVIRT_PKG_NAME=libvirt-bin
+ install_package libvirt-bin
+ elif is_fedora || is_suse; then
+ install_package libvirt
else
- LIBVIRT_PKG_NAME=libvirt
+ exit_distro_not_supported "libvirt installation"
fi
- install_package $LIBVIRT_PKG_NAME
+
# Install and configure **LXC** if specified. LXC is another approach to
# splitting a system into many smaller parts. LXC uses cgroups and chroot
# to simulate multiple systems.