summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Kraynev <skraynev@mirantis.com>2016-08-03 12:59:16 +0300
committerAlexey Khivin <akhivin@gmail.com>2016-08-08 20:51:39 +0000
commitcff7080d2e9e96d85c3ed8a863b412d1df0f6407 (patch)
treecbb2d0b13a5ac7433667463e3168f2200dcbbb22
parent95d03fed865a06760803724103fb35e61f75d913 (diff)
Fix errors reported by shellcheck for Puppet
Notes
Notes (review): Code-Review+2: Nikolay Mahotkin <nmakhotkin@mirantis.com> Code-Review+1: Kirill Zaitsev <kzaitsev@mirantis.com> Code-Review+2: Alexey Khivin <akhivin@gmail.com> Workflow+1: Alexey Khivin <akhivin@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 08 Aug 2016 21:28:26 +0000 Reviewed-on: https://review.openstack.org/350496 Project: openstack/ci-cd-pipeline-app-murano Branch: refs/heads/master
-rw-r--r--murano-apps/Puppet/package/Resources/scripts/core/exec_puppet_inline.sh4
-rw-r--r--murano-apps/Puppet/package/Resources/scripts/core/get_hiera_data.sh2
-rw-r--r--murano-apps/Puppet/package/Resources/scripts/core/install_puppet_module.sh2
-rw-r--r--murano-apps/Puppet/package/Resources/scripts/install/install_puppet.sh25
-rw-r--r--murano-apps/Puppet/package/Resources/scripts/server/install_dependencies.sh4
5 files changed, 19 insertions, 18 deletions
diff --git a/murano-apps/Puppet/package/Resources/scripts/core/exec_puppet_inline.sh b/murano-apps/Puppet/package/Resources/scripts/core/exec_puppet_inline.sh
index fcb736d..2bd736d 100644
--- a/murano-apps/Puppet/package/Resources/scripts/core/exec_puppet_inline.sh
+++ b/murano-apps/Puppet/package/Resources/scripts/core/exec_puppet_inline.sh
@@ -2,7 +2,7 @@
2 2
3set +e 3set +e
4 4
5PUPPET_CODE=`echo -n $1 | base64 -d` 5PUPPET_CODE=$(echo -n "$1" | base64 -d)
6 6
7puppet apply --detailed-exitcodes --color=false --execute "${PUPPET_CODE}" 7puppet apply --detailed-exitcodes --color=false --execute "${PUPPET_CODE}"
8 8
@@ -11,4 +11,4 @@ if [ "${PUPPET_RETURN}" -eq 4 ] || [ "${PUPPET_RETURN}" -eq 6 ] ; then
11 exit ${PUPPET_RETURN} 11 exit ${PUPPET_RETURN}
12fi 12fi
13 13
14set -e \ No newline at end of file 14set -e
diff --git a/murano-apps/Puppet/package/Resources/scripts/core/get_hiera_data.sh b/murano-apps/Puppet/package/Resources/scripts/core/get_hiera_data.sh
index bf16a0a..fa12b26 100644
--- a/murano-apps/Puppet/package/Resources/scripts/core/get_hiera_data.sh
+++ b/murano-apps/Puppet/package/Resources/scripts/core/get_hiera_data.sh
@@ -2,4 +2,4 @@
2 2
3KEY="$1" 3KEY="$1"
4 4
5hiera -c /etc/puppet/hiera.yaml $KEY 5hiera -c /etc/puppet/hiera.yaml "$KEY"
diff --git a/murano-apps/Puppet/package/Resources/scripts/core/install_puppet_module.sh b/murano-apps/Puppet/package/Resources/scripts/core/install_puppet_module.sh
index a59dc72..2e8f0fb 100644
--- a/murano-apps/Puppet/package/Resources/scripts/core/install_puppet_module.sh
+++ b/murano-apps/Puppet/package/Resources/scripts/core/install_puppet_module.sh
@@ -2,6 +2,6 @@
2 2
3module_name=$1 3module_name=$1
4 4
5sudo puppet module install ${module_name} 5sudo puppet module install "${module_name}"
6 6
7exit 7exit
diff --git a/murano-apps/Puppet/package/Resources/scripts/install/install_puppet.sh b/murano-apps/Puppet/package/Resources/scripts/install/install_puppet.sh
index 52c9d41..40ca22a 100644
--- a/murano-apps/Puppet/package/Resources/scripts/install/install_puppet.sh
+++ b/murano-apps/Puppet/package/Resources/scripts/install/install_puppet.sh
@@ -39,7 +39,7 @@ function is_ubuntu {
39 39
40function is_opensuse { 40function is_opensuse {
41 [ -f /usr/bin/zypper ] && \ 41 [ -f /usr/bin/zypper ] && \
42 cat /etc/os-release | grep -q -e "openSUSE" 42 grep -q -e "openSUSE" < /etc/os-release
43} 43}
44 44
45# dnf is a drop-in replacement for yum on Fedora>=22 45# dnf is a drop-in replacement for yum on Fedora>=22
@@ -145,17 +145,17 @@ function setup_puppet_ubuntu {
145 --assume-yes install -y --force-yes lsb-release 145 --assume-yes install -y --force-yes lsb-release
146 fi 146 fi
147 147
148 lsbdistcodename=`lsb_release -c -s` 148 lsbdistcodename=$(lsb_release -c -s)
149 if [ $lsbdistcodename != 'trusty' ] ; then 149 if [ "$lsbdistcodename" != 'trusty' ] ; then
150 rubypkg=rubygems 150 rubypkg=rubygems
151 else 151 else
152 rubypkg=ruby 152 rubypkg=ruby
153 fi 153 fi
154 154
155 155
156 PUPPET_VERSION=3.* 156 PUPPET_VERSION="3.*"
157 PUPPETDB_VERSION=2.* 157 PUPPETDB_VERSION="2.*"
158 FACTER_VERSION=2.* 158 FACTER_VERSION="2.*"
159 159
160 cat > /etc/apt/preferences.d/00-puppet.pref <<EOF 160 cat > /etc/apt/preferences.d/00-puppet.pref <<EOF
161Package: puppet puppet-common puppetmaster puppetmaster-common puppetmaster-passenger 161Package: puppet puppet-common puppetmaster puppetmaster-common puppetmaster-passenger
@@ -172,9 +172,9 @@ Pin-Priority: 501
172EOF 172EOF
173 173
174 puppet_deb=puppetlabs-release-${lsbdistcodename}.deb 174 puppet_deb=puppetlabs-release-${lsbdistcodename}.deb
175 wget http://apt.puppetlabs.com/$puppet_deb -O $puppet_deb 175 wget "http://apt.puppetlabs.com/$puppet_deb" -O "$puppet_deb"
176 dpkg -i $puppet_deb 176 dpkg -i "$puppet_deb"
177 rm $puppet_deb 177 rm "$puppet_deb"
178 178
179 apt-get update 179 apt-get update
180 DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \ 180 DEBIAN_FRONTEND=noninteractive apt-get --option 'Dpkg::Options::=--force-confold' \
@@ -186,8 +186,9 @@ EOF
186} 186}
187 187
188function setup_puppet_opensuse { 188function setup_puppet_opensuse {
189 local version=`grep -e "VERSION_ID" /etc/os-release | tr -d "\"" | cut -d "=" -f2` 189 local version=
190 zypper ar http://download.opensuse.org/repositories/systemsmanagement:/puppet/openSUSE_${version}/systemsmanagement:puppet.repo 190 version=$(grep -e "VERSION_ID" /etc/os-release | tr -d "\"" | cut -d "=" -f2)
191 zypper ar "http://download.opensuse.org/repositories/systemsmanagement:/puppet/openSUSE_${version}/systemsmanagement:puppet.repo"
191 zypper -v --gpg-auto-import-keys --no-gpg-checks -n ref 192 zypper -v --gpg-auto-import-keys --no-gpg-checks -n ref
192 zypper --non-interactive in --force-resolution puppet 193 zypper --non-interactive in --force-resolution puppet
193 # Wipe out templatedir so we don't get warnings about it 194 # Wipe out templatedir so we don't get warnings about it
@@ -259,4 +260,4 @@ else
259 exit 1 260 exit 1
260fi 261fi
261 262
262exit \ No newline at end of file 263exit
diff --git a/murano-apps/Puppet/package/Resources/scripts/server/install_dependencies.sh b/murano-apps/Puppet/package/Resources/scripts/server/install_dependencies.sh
index cc27d9b..ca8df60 100644
--- a/murano-apps/Puppet/package/Resources/scripts/server/install_dependencies.sh
+++ b/murano-apps/Puppet/package/Resources/scripts/server/install_dependencies.sh
@@ -5,7 +5,7 @@ ENV_NAME="$1"
5PUPPETFILE_LINK="$2" 5PUPPETFILE_LINK="$2"
6ENV_DIR="/etc/puppet/environments/${ENV_NAME}" 6ENV_DIR="/etc/puppet/environments/${ENV_NAME}"
7 7
8cd ${ENV_DIR} 8cd "${ENV_DIR}"
9wget --quiet -c ${PUPPETFILE_LINK} -O Puppetfile 9wget --quiet -c "${PUPPETFILE_LINK}" -O Puppetfile
10 10
11librarian-puppet install 11librarian-puppet install