Install python2 on newer Ubuntus
Newer Ubuntus like Xenial don't necessary have python2 preinstalled. If on Ubuntu and `python` is not present we install the python package so that pip and ansible are happy later on. Change-Id: Ia81c33b845664f35fba6fa8259bc83f8bcfec0e0
This commit is contained in:
parent
3f372b52cc
commit
1f97760989
@ -232,11 +232,6 @@ EOF
|
|||||||
fi
|
fi
|
||||||
dpkg -i $puppet_deb
|
dpkg -i $puppet_deb
|
||||||
rm $puppet_deb
|
rm $puppet_deb
|
||||||
|
|
||||||
# ansible also requires python2 on the host to run correctly.
|
|
||||||
# Make sure we have it, as some images come without it
|
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \
|
|
||||||
--assume-yes install python-minimal
|
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
@ -329,6 +324,16 @@ function setup_pip {
|
|||||||
pip install -U setuptools
|
pip install -U setuptools
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Need to install python2 early as pip and ansible need it and it
|
||||||
|
# isn't necessarily previously installed on newer Ubuntu releases.
|
||||||
|
if is_ubuntu; then
|
||||||
|
if ! which python > /dev/null 2<&1 ; then
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get update
|
||||||
|
DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \
|
||||||
|
--assume-yes install -y --force-yes python-minimal
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if $SETUP_PIP; then
|
if $SETUP_PIP; then
|
||||||
setup_pip
|
setup_pip
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user