Do not attempt to re-install docker, regardless of its running status
Commit c96032ecc1
changed the devstack
plugin to avoid reinstalling docker if the service was running.
However, there are a few meaningful cases where the service is not
running but the package is however installed and the user does not
want devstack to reinstall it.
This patch uses the distro package manager to find whether
docker-engine is insstalled already, rather than systemd or init.d.
The docker installation script will take care of cases where docker
was manually installed from binaries.
Change-Id: I6f66fdd3c35739486a6453b484eab81dfb4a9545
This commit is contained in:
parent
5799770c7b
commit
d32f09ffb6
@ -30,6 +30,16 @@ function install_etcd_data_store {
|
|||||||
rm -rf $DEST/etcd/db.etcd
|
rm -rf $DEST/etcd/db.etcd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function check_docker {
|
||||||
|
if is_ubuntu; then
|
||||||
|
dpkg -s docker-engine > /dev/null 2>&1
|
||||||
|
else
|
||||||
|
rpm -q docker-engine > /dev/null 2>&1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# main loop
|
# main loop
|
||||||
if is_service_enabled kuryr; then
|
if is_service_enabled kuryr; then
|
||||||
if [[ "$1" == "stack" && "$2" == "install" ]]; then
|
if [[ "$1" == "stack" && "$2" == "install" ]]; then
|
||||||
@ -86,10 +96,12 @@ if is_service_enabled kuryr; then
|
|||||||
# docker and specifically Kuryr. So, this works around that.
|
# docker and specifically Kuryr. So, this works around that.
|
||||||
sudo update-alternatives --install /bin/sh sh /bin/bash 100
|
sudo update-alternatives --install /bin/sh sh /bin/bash 100
|
||||||
|
|
||||||
# Install docker only if it does not exist in the system
|
# Install docker only if it's not already installed. The following checks
|
||||||
# We don't use `command -v docker` because other packages with binary
|
# whether the docker-engine package is already installed, as this is the
|
||||||
# called `docker` can be installed in the system
|
# most common way for installing docker from binaries. In case it's been
|
||||||
service docker status >/dev/null 2>&1 || {
|
# manually installed, the install_docker.sh script will prompt a warning
|
||||||
|
# if another docker executable is found
|
||||||
|
check_docker || {
|
||||||
wget http://get.docker.com -O install_docker.sh
|
wget http://get.docker.com -O install_docker.sh
|
||||||
sudo chmod 777 install_docker.sh
|
sudo chmod 777 install_docker.sh
|
||||||
sudo sh install_docker.sh
|
sudo sh install_docker.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user