Details
Description
The crontab filetype is quite old, with its class declaration outdated. Its current implementation uses `%x` instead of `Puppet::Util::Execution.execute` when executing some of the crontab commands, which is bad because any failures are swallowed. For example in read, any potential FileReadErrors are swallowed, which could lead to the behavior in PUP-9217 to occur. In remove, Puppet would have no idea whether removing the crontab entry succeeded or failed. Currently, remove is not being used anywhere so we have not yet run into any issues here; however, it would be good to fix this in case we ever do need to use it in the future.
The work in this ticket consists of updating the crontab filetype to use `Puppet::Util::Execution.execute`. It would also be nice to make it consistent with how `suntab` and `aixtab` are implemented, if possible, since it seems like the only difference between the three commands are their error messages.
Attachments
Issue Links
- blocks
-
PUP-9217 Crontab gets erased after error during agent run
-
- Closed
-