Make the tripleorc file set -u safe

We have had reports that when tripleorc is sourced by scripts which are
set -u (such as the "Devtest cloud initialization script" created by
Tuskar), execution is aborted because $ELEMENT_PATH is referenced before
it is set.

This change makes the first reference to $ELEMENT_PATH set -u safe - if
it's not set an empty string will be returned and the next line of code
will set it.

Change-Id: I0329fd4bdb6b5e360cf2464def6bace655827944
Closes-Bug: #1335105
This commit is contained in:
James Polley 2014-07-10 07:35:18 +02:00
parent 9651086079
commit 47e80890d4
1 changed files with 1 additions and 1 deletions

View File

@ -103,7 +103,7 @@ if [[ ! "\$PATH" =~ (^|:)"\$SCRIPTS_PATH"(:|$) ]]; then
fi
TIE_PATH=\$TRIPLEO_ROOT/tripleo-image-elements/elements
if [[ ! "\$ELEMENTS_PATH" =~ (^|:)"\$TIE_PATH"(:|$) ]]; then
if [[ "\${ELEMENTS_PATH:-}" !~ (^|:)"\$TIE_PATH"(:|$) ]]; then
export ELEMENTS_PATH=\$TIE_PATH\${ELEMENTS_PATH:+":\$ELEMENTS_PATH"}
fi