ncsa / puppetserver-enc

Setup and manage a database to use for Puppet External Node Classifier
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Formatting issues when output is "piped" #3

Open andylytical opened 3 years ago

andylytical commented 3 years ago

This is (or was) a known issue with Docker. (need link here)

Can we work around it?

Otherwise, add notes in README about "Known Issues" and include useful workarounds.

andylytical commented 3 years ago

Workaround suggestion: enc_adm -l >junk; <junk awk '$3=="production"{print $3,$1}'; rm -f junk

andylytical commented 3 years ago

Workaround suggestion:

andylytical commented 3 years ago

Possible update to enc_adm script:

outfn=$(mktemp)
docker-compose exec puppet /etc/puppetlabs/enc/admin.py "$@" >$outfn
cat $outfn
rm -f $outfn

This appears to resolve the issue for: enc_adm -l | awk '$3=="production"{print $3,$1}' Normally, this output is garbled (strings are run together, newlines do not actually make a line break).