From cff7080d2e9e96d85c3ed8a863b412d1df0f6407 Mon Sep 17 00:00:00 2001 From: Sergey Kraynev Date: Wed, 3 Aug 2016 12:59:16 +0300 Subject: [PATCH] Fix errors reported by shellcheck for Puppet Change-Id: I8277c6265501c74d07493f723472fbf4b85ca29e --- .../scripts/core/exec_puppet_inline.sh | 4 +-- .../Resources/scripts/core/get_hiera_data.sh | 2 +- .../scripts/core/install_puppet_module.sh | 2 +- .../scripts/install/install_puppet.sh | 25 ++++++++++--------- .../scripts/server/install_dependencies.sh | 4 +-- 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 @@ set +e -PUPPET_CODE=`echo -n $1 | base64 -d` +PUPPET_CODE=$(echo -n "$1" | base64 -d) puppet apply --detailed-exitcodes --color=false --execute "${PUPPET_CODE}" @@ -11,4 +11,4 @@ if [ "${PUPPET_RETURN}" -eq 4 ] || [ "${PUPPET_RETURN}" -eq 6 ] ; then exit ${PUPPET_RETURN} fi -set -e \ No newline at end of file +set -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 @@ KEY="$1" -hiera -c /etc/puppet/hiera.yaml $KEY +hiera -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 @@ module_name=$1 -sudo puppet module install ${module_name} +sudo puppet module install "${module_name}" exit 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 { function is_opensuse { [ -f /usr/bin/zypper ] && \ - cat /etc/os-release | grep -q -e "openSUSE" + grep -q -e "openSUSE" < /etc/os-release } # dnf is a drop-in replacement for yum on Fedora>=22 @@ -145,17 +145,17 @@ function setup_puppet_ubuntu { --assume-yes install -y --force-yes lsb-release fi - lsbdistcodename=`lsb_release -c -s` - if [ $lsbdistcodename != 'trusty' ] ; then + lsbdistcodename=$(lsb_release -c -s) + if [ "$lsbdistcodename" != 'trusty' ] ; then rubypkg=rubygems else rubypkg=ruby fi - PUPPET_VERSION=3.* - PUPPETDB_VERSION=2.* - FACTER_VERSION=2.* + PUPPET_VERSION="3.*" + PUPPETDB_VERSION="2.*" + FACTER_VERSION="2.*" cat > /etc/apt/preferences.d/00-puppet.pref <