Browse code

Enable universe repository on Ubuntu

The universe repository is not enabled when installing Ubuntu from an
ISO (at least for Bionic). This leads to some errors during the devstack
run that are not seen when running based on a cloud image which has that
repo enabled by default. Enable that repository unconditionally, the
operation is idempotent.

Change-Id: Ifcb7ecd78fb25ca2136f5848c19b74500e520873
Closes-Bug: 1792936

Jens Harbott authored on 2018/11/22 22:17:01
Showing 1 changed files
... ...
@@ -69,21 +69,29 @@ function fixup_keystone {
69 69
     fi
70 70
 }
71 71
 
72
-# Ubuntu Cloud Archive
73
-#---------------------
72
+# Ubuntu Repositories
73
+#--------------------
74 74
 # We've found that Libvirt on Xenial is flaky and crashes enough to be
75 75
 # a regular top e-r bug. Opt into Ubuntu Cloud Archive if on Xenial to
76 76
 # get newer Libvirt.
77 77
 # Make it possible to switch this based on an environment variable as
78 78
 # libvirt 2.5.0 doesn't handle nested virtualization quite well and this
79 79
 # is required for the trove development environment.
80
-function fixup_uca {
81
-    if [[ "${ENABLE_UBUNTU_CLOUD_ARCHIVE}" == "False" || "$DISTRO" != "xenial" ]]; then
80
+# Also enable universe since it is missing when installing from ISO.
81
+function fixup_ubuntu {
82
+    if [[ "$DISTRO" != "xenial" && "$DISTRO" != "bionic" ]]; then
82 83
         return
83 84
     fi
84 85
 
85 86
     # This pulls in apt-add-repository
86 87
     install_package "software-properties-common"
88
+
89
+    # Enable universe
90
+    sudo add-apt-repository -y universe
91
+
92
+    if [[ "${ENABLE_UBUNTU_CLOUD_ARCHIVE}" == "False" || "$DISTRO" != "xenial" ]]; then
93
+        return
94
+    fi
87 95
     # Use UCA for newer libvirt.
88 96
     if [[ -f /etc/ci/mirror_info.sh ]] ; then
89 97
         # If we are on a nodepool provided host and it has told us about where
... ...
@@ -249,7 +257,7 @@ function fixup_virtualenv {
249 249
 
250 250
 function fixup_all {
251 251
     fixup_keystone
252
-    fixup_uca
252
+    fixup_ubuntu
253 253
     fixup_python_packages
254 254
     fixup_fedora
255 255
     fixup_suse