Issue #9440 has been updated by Matthaus Litteken. Status changed from Duplicate to Re-opened Target version changed from 2.7.x to 2.7.4
Jeremy, Looks good. I've applied your patch and will be merging it today. ---------------------------------------- Bug #9440: Puppet destroys crontab files which contain whitespace before variables or comments https://projects.puppetlabs.com/issues/9440 Author: Jeremy Thornhill Status: Re-opened Priority: Normal Assignee: Matthaus Litteken Category: cron Target version: 2.7.4 Affected Puppet version: Keywords: cron Branch: I believe I've encountered a regression (or a corner case that was not fixed) from #1216. Agent and master are both version 2.7.1, cron is vixie-cron. One of our SAs copied in some variables from an old crontab, and during the process he introduced leading whitespace. Such lines should not be treated as syntax errors as per the vixie-cron documentation (the leading spaces are supposed to be simply ignored). The crontab he created has leading whitespace (four spaces) before a variable assignment, which precedes a valid non-indented cronjob: <pre> FOO=bar 5 0 * * * /usr/local/bin/myjob </pre> Puppet behaves really badly in this case; first it gives the following error: <pre> err: Could not prefetch cron provider 'crontab': Could not parse line " FOO=bar" at root:2 </pre> and then, it proceeds to discard everything in the existing crontab (#8138 ?), with the resulting crontab containing only the entries that are actually defined in puppet. Note that this behavior seems to only happen with indented comments or variable assignments. If you indent the actual cron job entry itself, the parser handles that properly. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
