From 703ff06d0f11f2a8cfdab7ce524febabe6e42f9f Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Fri, 9 Jun 2017 15:55:16 -0600 Subject: [PATCH] Fix rpms being installed via DeployArtifactURLs The deploy-artifacts.sh script is supposed to support installing rpms when provided by DeployArtifactUrls. The problem is that it uses yum to install which does not actually work unless the filename ends with .rpm. This change updates the script to rename the downloaded file to end with .rpm if it is an rpm so that it is properly installed. Change-Id: I048d2b4474f9efe424e98e3868f325704e9c352f Closes-Bug: #1697102 (cherry picked from commit 84e37fe8c7b10b7aceb7c97ffb97ede5480ea5ee) --- puppet/deploy-artifacts.sh | 8 ++++++-- .../fix-rpm-deploy-artifact-urls-03d5694073ad159d.yaml | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/fix-rpm-deploy-artifact-urls-03d5694073ad159d.yaml diff --git a/puppet/deploy-artifacts.sh b/puppet/deploy-artifacts.sh index 4e1ad89fe3..9f23186944 100644 --- a/puppet/deploy-artifacts.sh +++ b/puppet/deploy-artifacts.sh @@ -10,7 +10,9 @@ if [ -n "$artifact_urls" ]; then for URL in $(echo $artifact_urls | sed -e "s| |\n|g" | sort -u); do curl --globoff -o $TMP_DATA/file_data "$URL" if file -b $TMP_DATA/file_data | grep RPM &>/dev/null; then - yum install -y $TMP_DATA/file_data + mv $TMP_DATA/file_data $TMP_DATA/file_data.rpm + yum install -y $TMP_DATA/file_data.rpm + rm $TMP_DATA/file_data.rpm elif file -b $TMP_DATA/file_data | grep 'gzip compressed data' &>/dev/null; then pushd / tar xvzf $TMP_DATA/file_data @@ -19,7 +21,9 @@ if [ -n "$artifact_urls" ]; then echo "ERROR: Unsupported file format." exit 1 fi - rm $TMP_DATA/file_data + if [ -f $TMP_DATA/file_data ]; then + rm $TMP_DATA/file_data + fi done else echo "No artifact_urls was set. Skipping..." diff --git a/releasenotes/notes/fix-rpm-deploy-artifact-urls-03d5694073ad159d.yaml b/releasenotes/notes/fix-rpm-deploy-artifact-urls-03d5694073ad159d.yaml new file mode 100644 index 0000000000..25016e8319 --- /dev/null +++ b/releasenotes/notes/fix-rpm-deploy-artifact-urls-03d5694073ad159d.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix support for RPMs to be installed via DeployArtifactURLs. LP#1697102