Don't mix declaration and set of locals
Ia0957b47187c3dcadd46154b17022c4213781112 proposes to have bashate
find instances of setting a local value. The issue is that "local"
always returns 0, thus hiding any failure in the commands running to
set the variable.
This is an automated replacement of such instances
Depends-On: I676c805e8f0401f75cc5367eee83b3d880cdef81
Change-Id: I9c8912a8fd596535589b207d7fc553b9d951d3fe
diff --git a/lib/ldap b/lib/ldap
index d2dbc3b..0414fea 100644
--- a/lib/ldap
+++ b/lib/ldap
@@ -82,7 +82,8 @@
function init_ldap {
local keystone_ldif
- local tmp_ldap_dir=$(mktemp -d -t ldap.$$.XXXXXXXXXX)
+ local tmp_ldap_dir
+ tmp_ldap_dir=$(mktemp -d -t ldap.$$.XXXXXXXXXX)
# Remove data but not schemas
clear_ldap_state
@@ -113,7 +114,8 @@
echo "Installing LDAP inside function"
echo "os_VENDOR is $os_VENDOR"
- local tmp_ldap_dir=$(mktemp -d -t ldap.$$.XXXXXXXXXX)
+ local tmp_ldap_dir
+ tmp_ldap_dir=$(mktemp -d -t ldap.$$.XXXXXXXXXX)
printf "installing OpenLDAP"
if is_ubuntu; then
@@ -129,7 +131,8 @@
fi
echo "LDAP_PASSWORD is $LDAP_PASSWORD"
- local slappass=$(slappasswd -s $LDAP_PASSWORD)
+ local slappass
+ slappass=$(slappasswd -s $LDAP_PASSWORD)
printf "LDAP secret is $slappass\n"
# Create manager.ldif and add to olcdb