aboutsummaryrefslogtreecommitdiff
path: root/lib/puppet/provider/cron/crontab.rb
diff options
context:
space:
mode:
authorEnis Inan <enis.inan@puppet.com>2018-12-13 02:11:39 -0800
committerEnis Inan <enis.inan@puppet.com>2019-01-09 08:48:20 -0800
commita369886d68aa84a14defd3e594aa75cab71da328 (patch)
treea75646ceb991ba89bd5652391dd7896953173b46 /lib/puppet/provider/cron/crontab.rb
parente76bd24dcb33ab71440633303124ea99d59b7783 (diff)
downloadpuppet-cron_core-a369886d68aa84a14defd3e594aa75cab71da328.tar.gz
puppet-cron_core-a369886d68aa84a14defd3e594aa75cab71da328.tar.bz2
(MODULES-7789) Port over the PUP-9217 changes
PUP-9217 introduced the :raise_prefetch_errors option to the ParsedFile provider base class that, when set, will fail any resources associated with a failed prefetch target. Thus, when a file read error does occur, Puppet will fail all of the resources associated with the failed crontab (target). This means that the failed crontab will not be overwritten, thus fixing the issue described in the ticket. For more details, please refer to https://github.com/puppetlabs/puppet/commit/5b0fa987e5b7b27839e424ff16d59c7bf081c73a
Diffstat (limited to 'lib/puppet/provider/cron/crontab.rb')
-rw-r--r--lib/puppet/provider/cron/crontab.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb
index 8953109..4ba89e3 100644
--- a/lib/puppet/provider/cron/crontab.rb
+++ b/lib/puppet/provider/cron/crontab.rb
@@ -1,7 +1,7 @@
require_relative 'filetype'
require 'puppet/provider/parsedfile'
-Puppet::Type.type(:cron).provide(:crontab, parent: Puppet::Provider::ParsedFile, default_target: ENV['USER'] || 'root') do
+Puppet::Type.type(:cron).provide(:crontab, parent: Puppet::Provider::ParsedFile, default_target: ENV['USER'] || 'root', raise_prefetch_errors: true) do
commands crontab: 'crontab'
text_line :comment, match: %r{^\s*#}, post_parse: proc { |record|