Skip to content

Commit 7c7df4e

Browse files
committed
pip command improvements in plugin spec file updated
Signed-off-by: ashish-jabble <[email protected]>
1 parent b3c6420 commit 7c7df4e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

plugins/packages/RPM/SPECS/plugin.spec

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ PKG_NAME="__PACKAGE_NAME__"
111111
set -e
112112

113113

114+
OS_VERSION=$(cat /etc/os-release | grep 'VERSION_ID=' | cut -f2 -d= | sed 's/"//g')
114115

115116
set_files_ownership () {
116117
chown -R root:root /usr/local/fledge/__INSTALL_DIR__
@@ -127,10 +128,8 @@ fi
127128

128129
# Install any Python dependencies
129130
if [ -f /usr/local/fledge/__INSTALL_DIR__/requirements.txt ]; then
130-
bash << EOF
131-
scl enable rh-python36 bash
132-
pip install -Ir /usr/local/fledge/__INSTALL_DIR__/requirements.txt
133-
EOF
131+
if [[ ${OS_VERSION} == *"7"* ]]; then source scl_source enable rh-python36 bash; fi
132+
python3 -m pip install -Ir /usr/local/fledge/__INSTALL_DIR__/requirements.txt
134133
fi
135134

136135
echo __PLUGIN_NAME__ __PLUGIN_TYPE__ plugin is installed.

0 commit comments

Comments
 (0)