train
train copied to clipboard
Train needs more robust stat functionality on Linux
The current implementation of Stat functionality for Linux in Train is not robust enough to hand new / unknown linux variants.
There is logic at this line to determine if we should use --printf or -c when running the command: https://github.com/inspec/train/blob/6893b8ddfbb151b66c46d53569056756497b4e90/lib/train/extras/stat.rb#L37
This relies on a hard coded list of distros that need -c, which does not work when we encounter a new distro. It's made worse since the failures that occur here are not clear and you'd have to spend the time digging into train to fully understand where the stat command is failing.