Browse Source

Fix pip setup for RHEL 8

On RHEL 8, we have no pip but we have pip3, so we need to adapt the
pip detection and setup to this.

This also requires taking into account a new possible location for
packstack.rst, under /usr/local/share.

Change-Id: I3b93449fb4b7faabb15a8b186d2be1c174b754b6
tags/14.0.0.0rc1
Javier Pena 4 months ago
parent
commit
fe9620acd4
2 changed files with 13 additions and 2 deletions
  1. 2
    0
      packstack/installer/basedefs.py
  2. 11
    2
      run_tests.sh

+ 2
- 0
packstack/installer/basedefs.py View File

@@ -38,6 +38,8 @@ if os.path.exists(PACKSTACK_SRC_DOC):
38 38
     PACKSTACK_DOC = PACKSTACK_SRC_DOC
39 39
 elif os.path.exists(os.path.join(sys.prefix, 'share/packstack/packstack.rst')):
40 40
     PACKSTACK_DOC = os.path.join(sys.prefix, 'share/packstack/packstack.rst')
41
+elif os.path.exists('/usr/local/share/packstack/packstack.rst'):
42
+    PACKSTACK_DOC = '/usr/local/share/packstack/packstack.rst'
41 43
 else:
42 44
     PACKSTACK_DOC = '/usr/share/packstack/packstack.rst'
43 45
 

+ 11
- 2
run_tests.sh View File

@@ -178,7 +178,16 @@ else
178 178
 fi
179 179
 
180 180
 # Don't assume pip is installed
181
-which pip || $SUDO easy_install pip
181
+which pip3 && PIP=pip3
182
+if [ -z $PIP ]; then
183
+    if ([ "$OS_NAME" = "RedHat" ] || [ "$OS_NAME" = "CentOS" ]) && [ $OS_VERSION -gt 7 ]; then
184
+        $SUDO $PKG_MGR -y install python3-pip
185
+        PIP=pip3
186
+    else
187
+        which pip || $SUDO easy_install pip
188
+        PIP=pip
189
+    fi
190
+fi
182 191
 
183 192
 # Try to use pre-cached cirros images, if available, otherwise download them
184 193
 rm -rf /tmp/cirros
@@ -257,7 +266,7 @@ fi
257 266
 
258 267
 # Setup packstack
259 268
 if [ "${INSTALL_FROM_SOURCE}" = true ]; then
260
-  $SUDO pip install .
269
+  $SUDO $PIP install .
261 270
   # In Fedora when running with sudo gems are installed at /usr/local/bin/ even when GEM_HOME/GEM_BIN_DIR are set
262 271
   if [ "${PKG_MGR}" = "dnf" ]; then
263 272
       export GEM_BIN_DIR=/usr/local/bin/

Loading…
Cancel
Save