mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
Fedora Py3 compat
This commit is contained in:
parent
5626154a91
commit
bfb7c79465
1 changed files with 33 additions and 7 deletions
|
@ -3415,9 +3415,22 @@ install_debian_check_services() {
|
|||
#
|
||||
|
||||
install_fedora_deps() {
|
||||
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
|
||||
# Packages are named python3-<whatever>
|
||||
PY_PKG_VER=3
|
||||
__PACKAGES="python3-m2crypto python3-PyYAML"
|
||||
else
|
||||
PY_PKG_VER=2
|
||||
__PACKAGES="m2crypto"
|
||||
if [ "$DISTRO_MAJOR_VERSION" -ge 28 ]; then
|
||||
__PACKAGES="${__PACKAGES} python2-pyyaml"
|
||||
else
|
||||
__PACKAGES="${__PACKAGES} PyYAML"
|
||||
fi
|
||||
fi
|
||||
|
||||
__PACKAGES="dnf-utils libyaml m2crypto PyYAML python-crypto python-jinja2"
|
||||
__PACKAGES="${__PACKAGES} python2-msgpack python2-requests python-zmq"
|
||||
__PACKAGES="dnf-utils ${__PACKAGES} python${PY_PKG_VER}-crypto python${PY_PKG_VER}-requests python${PY_PKG_VER}-zmq"
|
||||
__PACKAGES="${__PACKAGES} libyaml python${PY_PKG_VER}-jinja2 python${PY_PKG_VER}-msgpack"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
dnf install -y ${__PACKAGES} || return 1
|
||||
|
@ -3474,6 +3487,12 @@ install_fedora_stable_post() {
|
|||
}
|
||||
|
||||
install_fedora_git_deps() {
|
||||
if [ -n "$_PY_EXE" ] && [ "$_PY_MAJOR_VERSION" -eq 3 ]; then
|
||||
# Packages are named python3-<whatever>
|
||||
PY_PKG_VER=3
|
||||
else
|
||||
PY_PKG_VER=2
|
||||
fi
|
||||
|
||||
if [ "$_INSECURE_DL" -eq $BS_FALSE ] && [ "${_SALT_REPO_URL%%://*}" = "https" ]; then
|
||||
dnf install -y ca-certificates || return 1
|
||||
|
@ -3487,10 +3506,10 @@ install_fedora_git_deps() {
|
|||
|
||||
__git_clone_and_checkout || return 1
|
||||
|
||||
__PACKAGES="python2-tornado systemd-python"
|
||||
__PACKAGES="python${PY_PKG_VER}-tornado python${PY_PKG_VER}-systemd"
|
||||
|
||||
if [ "$_INSTALL_CLOUD" -eq $BS_TRUE ]; then
|
||||
__PACKAGES="${__PACKAGES} python-libcloud python-netaddr"
|
||||
__PACKAGES="${__PACKAGES} python${PY_PKG_VER}-libcloud python${PY_PKG_VER}-netaddr"
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
|
@ -3506,10 +3525,17 @@ install_fedora_git_deps() {
|
|||
}
|
||||
|
||||
install_fedora_git() {
|
||||
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
|
||||
python setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install || return 1
|
||||
if [ "${_PY_EXE}" != "" ]; then
|
||||
_PYEXE=${_PY_EXE}
|
||||
echoinfo "Using the following python version: ${_PY_EXE} to install salt"
|
||||
else
|
||||
python setup.py ${SETUP_PY_INSTALL_ARGS} install || return 1
|
||||
_PYEXE='python2'
|
||||
fi
|
||||
|
||||
if [ -f "${_SALT_GIT_CHECKOUT_DIR}/salt/syspaths.py" ]; then
|
||||
${_PYEXE} setup.py --salt-config-dir="$_SALT_ETC_DIR" --salt-cache-dir="${_SALT_CACHE_DIR}" ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1
|
||||
else
|
||||
${_PYEXE} setup.py ${SETUP_PY_INSTALL_ARGS} install --prefix=/usr || return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue