Architecture #8464
closed
Make environment variables parse easier
Added by Janos Mattyasovszky over 8 years ago.
Updated about 8 years ago.
Category:
System techniques
Description
Hi,
Regarding #7772 which was introduced by #7094, would it make sense to replace that env -0
or sed-magic to get the env. keys with something simpler, like this?
awk 'BEGIN { for (k in ENVIRON) { print k }; }'
The question is only, if awk is available on all systems that rudder-agent is supposed to work on (since you have rudder agent run's output piped through a pretty complex awk script, I presume "yes"?)
- Related to Bug #7772: Agent processes parts of the environment (multiline bash variables) on systems without "env --null" support added
- Related to Bug #7094: Agent processes parts of the environment (multiline bash variables) added
Apparently awk adds the AWKPATH
variable to its environment, possible spoiling it, but all others seem to be included, and nothing else is missing:
# diff <(env -0 | awk -F'=' 'BEGIN { RS = "\0" } ; {print $1}' | sort) <(awk 'BEGIN { for (k in ENVIRON) { print k }; }' | sort)
1a2
> AWKPATH
- Assignee changed from Jonathan CLARKE to Benoît PECCATTE
- Tracker changed from Bug to Architecture
- Category set to System techniques
- Target version set to 4.0.0~rc2
It could simplify code.
Targeting to 3.3 since it's not a bug, just code simplification.
- Status changed from Discussion to In progress
- Status changed from In progress to Pending technical review
- Assignee changed from Benoît PECCATTE to Jonathan CLARKE
- Pull Request set to https://github.com/Normation/rudder-techniques/pull/973
- Assignee changed from Jonathan CLARKE to Alexis Mousset
Alexis, please take a look on that as Jon is not very available in the comming weeks
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
- Target version changed from 4.0.0~rc2 to 318
- Target version changed from 318 to 4.0.0~rc2
- Target version changed from 4.0.0~rc2 to 4.0.0~rc1
- Status changed from Pending release to Released
This bug has been fixed in Rudder 4.0.0 which was released the 10th November 2016.
Also available in: Atom
PDF