From dd42efd5323314047d2c44e02f2f7e3472954697 Mon Sep 17 00:00:00 2001 From: Gabriel Nagy Date: Fri, 1 Oct 2021 14:57:09 +0300 Subject: (MODULES-11197) Update to pdk-templates 2.2.0 Includes REFERENCE.md ToC fixes for MODULES-8183. --- lib/puppet/provider/cron/crontab.rb | 1 - lib/puppet/provider/cron/filetype.rb | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'lib/puppet/provider') diff --git a/lib/puppet/provider/cron/crontab.rb b/lib/puppet/provider/cron/crontab.rb index 12ad7f1..e07a669 100644 --- a/lib/puppet/provider/cron/crontab.rb +++ b/lib/puppet/provider/cron/crontab.rb @@ -32,7 +32,6 @@ Puppet::Type.type(:cron).provide(:crontab, parent: Puppet::Provider::ParsedFile, match: %r{^\s*(@\w+|\S+\s+\S+\s+\S+\s+\S+\s+\S+)\s+(.+)$}, absent: '*', block_eval: :instance do - def post_parse(record) time = record.delete(:time) match = %r{@(\S+)}.match(time) diff --git a/lib/puppet/provider/cron/filetype.rb b/lib/puppet/provider/cron/filetype.rb index 153285d..455ec07 100644 --- a/lib/puppet/provider/cron/filetype.rb +++ b/lib/puppet/provider/cron/filetype.rb @@ -12,7 +12,7 @@ class Puppet::Provider::Cron # autoloader meaning that, without this wrapper, the crontab filetypes # would be re-defined, causing Puppet to raise an exception. def newfiletype(name, &block) - return if @filetypes && @filetypes.key?(name) + return if @filetypes&.key?(name) base_newfiletype(name, &block) end @@ -54,11 +54,11 @@ class Puppet::Provider::Cron rescue => detail case detail.to_s when %r{no crontab for} - return '' + '' when %r{are not allowed to} Puppet.debug _('The %{path} user is not authorized to use cron. Their crontab file is treated as empty in case Puppet authorizes them in the middle of the run (by, for example, modifying the cron.deny or cron.allow files).') % { path: @path } - return '' + '' else raise FileReadError, _('Could not read crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace end @@ -117,11 +117,11 @@ class Puppet::Provider::Cron rescue => detail case detail.to_s when %r{can't open your crontab} - return '' + '' when %r{you are not authorized to use cron} Puppet.debug _('The %{path} user is not authorized to use cron. Their crontab file is treated as empty in case Puppet authorizes them in the middle of the run (by, for example, modifying the cron.deny or cron.allow files).') % { path: @path } - return '' + '' else raise FileReadError, _('Could not read crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace end @@ -168,11 +168,11 @@ class Puppet::Provider::Cron rescue => detail case detail.to_s when %r{open.*in.*directory} - return '' + '' when %r{not.*authorized.*cron} Puppet.debug _('The %{path} user is not authorized to use cron. Their crontab file is treated as empty in case Puppet authorizes them in the middle of the run (by, for example, modifying the cron.deny or cron.allow files).') % { path: @path } - return '' + '' else raise FileReadError, _('Could not read crontab for %{path}: %{detail}') % { path: @path, detail: detail }, detail.backtrace end -- cgit v1.2.3