make openstack cli -f shell output friendly to bash
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cliff |
Fix Released
|
Undecided
|
Steve Martinelli | ||
python-openstackclient |
Invalid
|
Undecided
|
Unassigned |
Bug Description
openstack cli is returning a set of variables like for example:
admin_state_
id="aabd57f5-
name="public"
provider:
When we use eval for passing all these data to environment variables and they get parsed by script.
We do have problem when openstack returns variables like:
provider:
Because the character : is not a a valid character for variable names, also there are variables containing the character -
We could have workaround this by using tr :- _ however then one lose the exit return code with echo $?.
Can we request to implement this a way that all variables returned from openstack cli are shell friendly without characters like : or - only characters allowed to environment variables?
Can be reproduced with:
eval `openstack network show public -f shell`
Results are:
bash: provider:
Expected results would be:
openstack network show public -f shell returning the variables in shell friendly way without characters like : or -.
Thanks!
Robin
Not sure how easy this'll be to maintain. When we "show" a resource, the properties we are displaying often come from the server's response. So, although we could fix this for your specific example, I'm not sure we could actively prevent this from coming up again.