@@ -38,6 +38,7 @@ apt-get install -y --no-install-recommends curl sudo libgssapi-krb5-2 busybox pr
3838# Install Python and necessary packages
3939PY_SHORT=${PYTHON_VERSION% .* }
4040wget -O /tmp/python.tgz https://www.python.org/ftp/python/${PYTHON_VERSION} /Python-${PYTHON_VERSION} .tgz
41+ echo " $PYTHON_MD5 /tmp/python.tgz" | md5sum --check
4142mkdir -p /tmp/pyinstall
4243tar -xzC /tmp/pyinstall/ --strip-components=1 -f /tmp/python.tgz
4344rm /tmp/python.tgz
@@ -50,16 +51,18 @@ ln -sf /usr/bin/pip${PY_SHORT} /usr/bin/pip
5051# For ansible apt module
5152cd /tmp
5253apt-get download python3-apt=1.8.4.3
53- dpkg -x python3-apt_1.8.4.3_amd64.deb python3-apt
54- rm python3-apt_1.8.4.3_amd64.deb
54+ ARCH=` arch`
55+ PKG_ARCH=` dpkg --print-architecture`
56+ dpkg -x python3-apt_1.8.4.3_${PKG_ARCH} .deb python3-apt
57+ rm python3-apt_1.8.4.3_${PKG_ARCH} .deb
5558cp -r /tmp/python3-apt/usr/lib/python3/dist-packages/* /usr/lib/python${PY_SHORT} /site-packages/
5659cd /usr/lib/python${PY_SHORT} /site-packages/
57- cp apt_pkg.cpython-37m-x86_64 -linux-gnu.so apt_pkg.so
58- cp apt_inst.cpython-37m-x86_64 -linux-gnu.so apt_inst.so
60+ cp apt_pkg.cpython-37m-${ARCH} -linux-gnu.so apt_pkg.so
61+ cp apt_inst.cpython-37m-${ARCH} -linux-gnu.so apt_inst.so
5962rm -rf /tmp/python3-apt
6063# Install splunk-ansible dependencies
6164cd /
62- pip -q --no-cache-dir install six wheel requests ansible jmespath --upgrade
65+ pip -q --no-cache-dir install six wheel requests cryptography==3.3.2 ansible jmespath --upgrade
6366# Remove tests packaged in python libs
6467find /usr/lib/ -depth \( -type d -a -not -wholename ' */ansible/plugins/test' -a \( -name test -o -name tests -o -name idle_test \) \) -exec rm -rf ' {}' \;
6568find /usr/lib/ -depth \( -type f -a -name ' *.pyc' -o -name ' *.pyo' -o -name ' *.a' \) -exec rm -rf ' {}' \;
0 commit comments