Architecture #8464
closedMake environment variables parse easier
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"?)
Updated by Janos Mattyasovszky over 8 years ago
- Related to Bug #7772: Agent processes parts of the environment (multiline bash variables) on systems without "env --null" support added
Updated by Janos Mattyasovszky over 8 years ago
- Related to Bug #7094: Agent processes parts of the environment (multiline bash variables) added
Updated by Janos Mattyasovszky over 8 years ago
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
Updated by Jonathan CLARKE over 8 years ago
- Assignee changed from Jonathan CLARKE to Benoît PECCATTE
Updated by Benoît PECCATTE over 8 years ago
- 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.
Updated by Benoît PECCATTE over 8 years ago
- Status changed from Discussion to In progress
Updated by Benoît PECCATTE over 8 years ago
- 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
Updated by François ARMAND over 8 years ago
- 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
Updated by Benoît PECCATTE over 8 years ago
- Status changed from Pending technical review to Pending release
- % Done changed from 0 to 100
Applied in changeset rudder-techniques|eaa766ae3949c6c2a6676fdcd9fb247d16f9cc78.
Updated by Benoît PECCATTE about 8 years ago
- Target version changed from 4.0.0~rc2 to 318
Updated by Vincent MEMBRÉ about 8 years ago
- Target version changed from 318 to 4.0.0~rc2
Updated by Vincent MEMBRÉ about 8 years ago
- Target version changed from 4.0.0~rc2 to 4.0.0~rc1
Updated by Alexis Mousset about 8 years ago
- Status changed from Pending release to Released
This bug has been fixed in Rudder 4.0.0 which was released the 10th November 2016.