openstack-charmers / charmed-openstack-tester

Deploys OpenStack clouds and runs tempest (or other tests) against them
Apache License 2.0
6 stars 14 forks source link

Use _OS_PARAMS as an array in novarc scripts #78

Open guimaluf opened 2 years ago

guimaluf commented 2 years ago

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.

ajkavanagh commented 2 years ago

@guimaluf thanks for the patch; just have a query/comment on whether the scripts should actually have a #! header.

guimaluf commented 2 years ago

@ajkavanagh adding the shebang to the sourced file doesn't work because if we want source novarc to affect the current environment, since running it in a subshell will not affect the current environment variables.

FTR the way to reproduce the issue above.

$ source novarc
$ source novarc                                                                                                                                                                        ✹ ✭
novarc:unset:6: OS_USERNAME OS_PASSWORD OS_TENANT_NAME OS_REGION_NAME OS_AUTH_URL OS_AUTH_TYPE: invalid parameter name
ajkavanagh commented 2 years ago

@ajkavanagh adding the shebang to the sourced file doesn't work because if we want source novarc to affect the current environment, since running it in a subshell will not affect the current environment variables.

FTR the way to reproduce the issue above.

$ source novarc
$ source novarc                                                                                                                                                                        ✹ ✭
novarc:unset:6: OS_USERNAME OS_PASSWORD OS_TENANT_NAME OS_REGION_NAME OS_AUTH_URL OS_AUTH_TYPE: invalid parameter name

ah, I forgot they were sourced. That's annoying. I guess we'll just have to switch to formal arrays. Thanks for the patch.