Browse Source

Fix errors reported by shellcheck for SystemConfig and OpenLDAP

Change-Id: I95dd70789c28d6c9727c75ca29ee618a72ba4e27
Sergey Kraynev 2 years ago
parent
commit
a4a52e5b54

+ 6
- 6
murano-apps/OpenLDAP/package/Resources/scripts/configureOpenLDAPUser.sh View File

@@ -8,20 +8,20 @@ EMAIL="$6"
8 8
 
9 9
 DOMAIN_PASSWORD="$ADMIN_PASSWORD"
10 10
 
11
-NAME="`echo "$DOMAIN" | cut -d. -f1`"
12
-TLD="`echo "$DOMAIN" | cut -d. -f2`"
11
+NAME="$(echo "$DOMAIN" | cut -d. -f1)"
12
+TLD="$(echo "$DOMAIN" | cut -d. -f2)"
13 13
 
14 14
 # If user doesn't specify non-admin username/password then
15 15
 # script will create just admin user
16 16
 
17
-if [ -z $USERNAME ];
17
+if [ -z "$USERNAME" ];
18 18
   then
19 19
     USERNAME="$ADMIN_USERNAME";
20 20
     PASSWORD="$ADMIN_PASSWORD";
21 21
 fi
22 22
 
23 23
 
24
-ldapadd -x -w $DOMAIN_PASSWORD -D "cn=${ADMIN_USERNAME},dc=${NAME},dc=${TLD}" << USER
24
+ldapadd -x -w "$DOMAIN_PASSWORD" -D "cn=${ADMIN_USERNAME},dc=${NAME},dc=${TLD}" << USER
25 25
 dn: uid=${USERNAME},ou=users,dc=${NAME},dc=${TLD}
26 26
 objectClass: top
27 27
 objectClass: posixAccount
@@ -42,7 +42,7 @@ shadowWarning: 0
42 42
 mail: ${EMAIL}
43 43
 USER
44 44
 
45
-ldappasswd -w $DOMAIN_PASSWORD -s ${PASSWORD} -D "cn=${ADMIN_USERNAME},dc=${NAME},dc=${TLD}" -x uid=${USERNAME},ou=users,dc=${NAME},dc=${TLD}
45
+ldappasswd -w "$DOMAIN_PASSWORD" -s "${PASSWORD}" -D "cn=${ADMIN_USERNAME},dc=${NAME},dc=${TLD}" -x "uid=${USERNAME},ou=users,dc=${NAME},dc=${TLD}"
46 46
 
47 47
 # check if user been created
48
-ldapwhoami -x -w ${PASSWORD} -D uid=${USERNAME},ou=users,dc=${NAME},dc=${TLD} -hlocalhost -p389
48
+ldapwhoami -x -w "${PASSWORD}" -D "uid=${USERNAME},ou=users,dc=${NAME},dc=${TLD}" -hlocalhost -p389

+ 7
- 7
murano-apps/SystemConfig/package/Resources/scripts/deploy.sh View File

@@ -9,24 +9,24 @@ logger Cloning openstack-ci system-config
9 9
 repository_name="$(basename "$URL")"
10 10
 
11 11
 if [ -n "$PATCH_ID" ] ; then
12
-   git clone $URL
13
-   pushd $repository_name
14
-       patch_ref=`git ls-remote | grep $PATCH_ID | tail -1 | awk '{print $2}'`
12
+   git clone "$URL"
13
+   pushd "$repository_name"
14
+       patch_ref=$(git ls-remote | grep "$PATCH_ID" | tail -1 | awk '{print $2}')
15 15
        if [ -z "$patch_ref" ] ; then
16 16
            echo "Patch id $PATCH_ID is not correct."
17 17
            exit 1
18 18
        fi
19
-       git fetch $URL $patch_ref && git checkout "FETCH_HEAD"
19
+       git fetch "$URL" "$patch_ref" && git checkout "FETCH_HEAD"
20 20
    popd
21 21
 elif [ -n "$BRANCH" ] ; then
22
-  git clone $URL --branch $BRANCH
22
+  git clone "$URL" --branch "$BRANCH"
23 23
 else
24
-  git clone $URL
24
+  git clone "$URL"
25 25
 fi
26 26
 
27 27
 logger Installing openstack-ci system-config
28 28
 
29
-pushd $repository_name
29
+pushd "$repository_name"
30 30
     ./install_modules.sh
31 31
 
32 32
     cp -r modules/ /etc/puppet/

Loading…
Cancel
Save