Skip to content

Commit

Permalink
Use _OS_PARAMS as an array in novarc scripts
Browse files Browse the repository at this point in the history
ZHS doesn't deal properly with the space-delimited array of _OS_PARAMS
when sourcing novarc*.

```
novarc:unset:5: OS_AUTH_URL ...: invalid parameter name
```

This commit encloses the array so it will work fine in both bash and zsh
environments.
  • Loading branch information
guimaluf committed Jul 14, 2022
1 parent 61a04ff commit 1619614
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions scripts/novarc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
_OS_PARAMS=($(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' '))
for param in ${_OS_PARAMS[@]}; do
if [ "$param" = "OS_AUTH_PROTOCOL" ]; then continue; fi
if [ "$param" = "OS_CACERT" ]; then continue; fi
unset $param
Expand Down
4 changes: 2 additions & 2 deletions scripts/novarc_unset_all
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
_OS_PARAMS=($(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' '))
for param in ${_OS_PARAMS[@]}; do
unset $param
done
unset _OS_PARAMS
4 changes: 2 additions & 2 deletions scripts/novarcv3_demo_project
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
_OS_PARAMS=($(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' '))
for param in ${_OS_PARAMS[@]}; do
if [ "$param" = "OS_AUTH_PROTOCOL" ]; then continue; fi
if [ "$param" = "OS_CACERT" ]; then continue; fi
unset $param
Expand Down
4 changes: 2 additions & 2 deletions scripts/novarcv3_domain
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
_OS_PARAMS=($(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' '))
for param in ${_OS_PARAMS[@]}; do
if [ "$param" = "OS_AUTH_PROTOCOL" ]; then continue; fi
if [ "$param" = "OS_CACERT" ]; then continue; fi
unset $param
Expand Down
4 changes: 2 additions & 2 deletions scripts/novarcv3_project
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
_OS_PARAMS=($(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' '))
for param in ${_OS_PARAMS[@]}; do
if [ "$param" = "OS_AUTH_PROTOCOL" ]; then continue; fi
if [ "$param" = "OS_CACERT" ]; then continue; fi
unset $param
Expand Down
4 changes: 2 additions & 2 deletions scripts/novarcv3_ssl_domain
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
_OS_PARAMS=($(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' '))
for param in ${_OS_PARAMS[@]}; do
if [ "$param" = "OS_AUTH_PROTOCOL" ]; then continue; fi
if [ "$param" = "OS_CACERT" ]; then continue; fi
unset $param
Expand Down
4 changes: 2 additions & 2 deletions scripts/novarcv3_ssl_project
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_OS_PARAMS=$(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' ')
for param in $_OS_PARAMS; do
_OS_PARAMS=($(env | awk 'BEGIN {FS="="} /^OS_/ {print $1;}' | paste -sd ' '))
for param in ${_OS_PARAMS[@]}; do
if [ "$param" = "OS_AUTH_PROTOCOL" ]; then continue; fi
if [ "$param" = "OS_CACERT" ]; then continue; fi
unset $param
Expand Down

0 comments on commit 1619614

Please sign in to comment.