rcbops / rpc-upgrades

Leapfrog/Incremental Upgrades for RPC OpenStack
0 stars 17 forks source link

Function ensure_working_dir references variable not yet exported #385

Closed JCallicoat closed 4 years ago

JCallicoat commented 4 years ago

The ensure_working_dir function in https://github.com/rcbops/rpc-upgrades/blob/master/incremental/lib/functions.sh references RPC_PRODUCT_RELEASE. The function is called from discover_code_version which is called from https://github.com/rcbops/rpc-upgrades/blob/master/incremental/incremental-upgrade.sh#L22 but the variable is not exported until https://github.com/rcbops/rpc-upgrades/blob/master/incremental/incremental-upgrade.sh#L78

JCallicoat commented 4 years ago

I still hit an error on this with the new code:

lib/functions.sh: line 23: RPC_PRODUCT_RELEASE: unbound variable

I definitely have the new version checked out:

incremental/lib/functions.sh:23: if [ -n "${RPC_PRODUCT_RELEASE}" ]; then

It looks like it's because incremental-upgrade.sh has set -evu and -u is:

Treat unset variables and parameters other than the special parameters ‘@’ or ‘*’ as an error when performing parameter expansion. An error message will be written to the standard error, and a non-interactive shell will exit.

BjoernT commented 4 years ago

I removed -u parameter for now until I rethink this