summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2016-05-25 21:06:45 -0400
committerTim Rozet <trozet@redhat.com>2016-05-25 21:06:45 -0400
commit4aa264aa97b81f2b40434da55745b4ade4a8a2ab (patch)
treeceba685efd36230636bb5f6fd6b88b5f6fe82007
parentb417f69a136a032a3a6f6075abecb7b10ed64167 (diff)
Apex: Fixes RPM checking in virtual deployment
Change-Id: I2e02f16173ec495e250bc60bc225ad1bb6a91828 Signed-off-by: Tim Rozet <trozet@redhat.com>
-rwxr-xr-xjjb/apex/apex-deploy-virtual.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/jjb/apex/apex-deploy-virtual.sh b/jjb/apex/apex-deploy-virtual.sh
index c7fb17e8c..4d9b03088 100755
--- a/jjb/apex/apex-deploy-virtual.sh
+++ b/jjb/apex/apex-deploy-virtual.sh
@@ -92,27 +92,30 @@ if [[ $BUILD_DIRECTORY == *verify-master* ]]; then
export PYTHONPATH=$PYTHONPATH:${WORKSPACE}/lib/python
fi
else
- VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | sed 's/opnfv-apex-//')
+ VERSION_EXTENSION=$(echo $(basename $RPM_LIST) | grep -Eo '[0-9]+\.[0-9]+-[0-9]{8}')
for pkg in common undercloud opendaylight-sfc onos; do
- RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}"
+ RPM_LIST+=" ${RPM_INSTALL_PATH}/opnfv-apex-${pkg}-${VERSION_EXTENSION}.noarch.rpm"
done
# update / install the new rpm
if rpm -q opnfv-apex > /dev/null; then
INSTALLED_RPMS=$(rpm -qa | grep apex)
for x in $INSTALLED_RPMS; do
- INSTALLED_RPM_VER=$(echo $x | sed 's/opnfv-apex-//').rpm
+ INSTALLED_RPM_VER=$(echo $x | grep -Eo '[0-9]+\.[0-9]+-[0-9]{8}')
# Does each RPM's version match the version required for deployment
if [ "$INSTALLED_RPM_VER" == "$VERSION_EXTENSION" ]; then
echo "RPM $x is already installed"
else
- echo "RPM $x does not match $VERSION_EXTENSION"
+ echo "RPM $x does not match version $VERSION_EXTENSION"
echo "Will upgrade/downgrade RPMs..."
# Try to upgrade/downgrade RPMS
if sudo yum update -y $RPM_LIST | grep "does not update installed package"; then
if ! sudo yum downgrade -y $RPM_LIST; then
sudo yum remove -y opnfv-apex-undercloud opnfv-apex-common opnfv-apex-opendaylight-sfc opnfv-apex-onos
- sudo yum downgrade -y $RPM_INSTALL_PATH
+ if ! sudo yum downgrade -y $RPM_LIST; then
+ echo "Unable to downgrade RPMs: $RPM_LIST"
+ exit 1
+ fi
fi
fi
break