Age | Commit message (Collapse) | Author |
|
The `filetype` provider executes `crontab` using Puppet's execution API, which
returns ProcessOutput objects that inherit from String. See puppetlabs/puppet@732d450
The provider later uses String#gsub to strip off the HEADER. In Ruby 2.7, the
gsub method returns a new instance of ProcessOutput:
irb(main):002:0> Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class
=> Puppet::Util::Execution::ProcessOutput
If you later serialize the crontab entries to YAML using `puppet resource`, then
puppet warns about serializing unknown data types:
# puppet resource cron --to_yaml
Warning: Cron[unmanaged:/etc/init.d/script.sh-1]['command'] contains a Puppet::Util::Execution::ProcessOutput value. It will be converted to the String '/etc/init.d/script.sh'
This wasn't an issue with Ruby 3.2, because String#gsub always returns a String:
irb(main):002:0> Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class
=> String
This commit explicitly converts the ProcessOutput to a String so the provider
behaves consistently on all Ruby versions.
Fixes #61
|
|
Includes REFERENCE.md ToC fixes for MODULES-8183.
|
|
Took the safest route and disabled cops either globally in .rubocop.yml
for just for specific cases in lib/
|
|
On Gentoo there's always a .keep_<package>-<slot> (e.g.,
.keep_cronbase-0) file inside the cron directory to ensure it's not
removed with rmdir. Since usernames are very unlikely to start with
.keep_, we can safely filter out these hidden files.
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|