summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Pena <jpena@redhat.com>2019-02-14 15:53:19 +0100
committerJavier Pena <jpena@redhat.com>2019-02-19 17:33:59 +0100
commitfe9620acd47b960556bc9ee19a1b723880a512aa (patch)
tree43af873bc8b723b167a12fbcd5a594c2cbb2869e
parentd84fd14687fea00b6915560d8ed3c651e133fbd1 (diff)
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
Notes
Notes (review): Code-Review+1: yatin <ykarel@redhat.com> Code-Review+1: Jon Schlueter <jschluet@redhat.com> Code-Review+2: Alfredo Moralejo <amoralej@redhat.com> Workflow+1: Alfredo Moralejo <amoralej@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 20 Feb 2019 13:30:19 +0000 Reviewed-on: https://review.openstack.org/636977 Project: openstack/packstack Branch: refs/heads/master
-rw-r--r--packstack/installer/basedefs.py2
-rwxr-xr-xrun_tests.sh13
2 files changed, 13 insertions, 2 deletions
diff --git a/packstack/installer/basedefs.py b/packstack/installer/basedefs.py
index 5a66737..6a496ee 100644
--- a/packstack/installer/basedefs.py
+++ b/packstack/installer/basedefs.py
@@ -38,6 +38,8 @@ if os.path.exists(PACKSTACK_SRC_DOC):
38 PACKSTACK_DOC = PACKSTACK_SRC_DOC 38 PACKSTACK_DOC = PACKSTACK_SRC_DOC
39elif os.path.exists(os.path.join(sys.prefix, 'share/packstack/packstack.rst')): 39elif os.path.exists(os.path.join(sys.prefix, 'share/packstack/packstack.rst')):
40 PACKSTACK_DOC = os.path.join(sys.prefix, 'share/packstack/packstack.rst') 40 PACKSTACK_DOC = os.path.join(sys.prefix, 'share/packstack/packstack.rst')
41elif os.path.exists('/usr/local/share/packstack/packstack.rst'):
42 PACKSTACK_DOC = '/usr/local/share/packstack/packstack.rst'
41else: 43else:
42 PACKSTACK_DOC = '/usr/share/packstack/packstack.rst' 44 PACKSTACK_DOC = '/usr/share/packstack/packstack.rst'
43 45
diff --git a/run_tests.sh b/run_tests.sh
index 08a35e9..891bfae 100755
--- a/run_tests.sh
+++ b/run_tests.sh
@@ -178,7 +178,16 @@ else
178fi 178fi
179 179
180# Don't assume pip is installed 180# Don't assume pip is installed
181which pip || $SUDO easy_install pip 181which pip3 && PIP=pip3
182if [ -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
190fi
182 191
183# Try to use pre-cached cirros images, if available, otherwise download them 192# Try to use pre-cached cirros images, if available, otherwise download them
184rm -rf /tmp/cirros 193rm -rf /tmp/cirros
@@ -257,7 +266,7 @@ fi
257 266
258# Setup packstack 267# Setup packstack
259if [ "${INSTALL_FROM_SOURCE}" = true ]; then 268if [ "${INSTALL_FROM_SOURCE}" = true ]; then
260 $SUDO pip install . 269 $SUDO $PIP install .
261 # In Fedora when running with sudo gems are installed at /usr/local/bin/ even when GEM_HOME/GEM_BIN_DIR are set 270 # In Fedora when running with sudo gems are installed at /usr/local/bin/ even when GEM_HOME/GEM_BIN_DIR are set
262 if [ "${PKG_MGR}" = "dnf" ]; then 271 if [ "${PKG_MGR}" = "dnf" ]; then
263 export GEM_BIN_DIR=/usr/local/bin/ 272 export GEM_BIN_DIR=/usr/local/bin/