<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet-cron_core/lib/puppet, branch main</title>
<subtitle>Puppet module for core cron functionality</subtitle>
<id>https://cgit.fluxo.info/puppet-cron_core/atom?h=main</id>
<link rel='self' href='https://cgit.fluxo.info/puppet-cron_core/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/'/>
<updated>2023-11-22T23:13:28+00:00</updated>
<entry>
<title>Convert ProcessOutput to String explicitly</title>
<updated>2023-11-22T23:13:28+00:00</updated>
<author>
<name>Josh Cooper</name>
<email>joshcooper@users.noreply.github.com</email>
</author>
<published>2023-11-22T18:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=be5ae9bc9e198a00f2a790992b663dda374006ba'/>
<id>urn:sha1:be5ae9bc9e198a00f2a790992b663dda374006ba</id>
<content type='text'>
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&gt; Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class
    =&gt; 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&gt; Puppet::Util::Execution::ProcessOutput.new("# HEADER\n0 4 * * * /etc/init.d/script.sh\n", 0).gsub(/# HEADER/, '').class
    =&gt; String

This commit explicitly converts the ProcessOutput to a String so the provider
behaves consistently on all Ruby versions.

Fixes #61
</content>
</entry>
<entry>
<title>(MODULES-11197) Update to pdk-templates 2.2.0</title>
<updated>2021-10-01T11:57:09+00:00</updated>
<author>
<name>Gabriel Nagy</name>
<email>gabriel.nagy@puppet.com</email>
</author>
<published>2021-10-01T11:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=dd42efd5323314047d2c44e02f2f7e3472954697'/>
<id>urn:sha1:dd42efd5323314047d2c44e02f2f7e3472954697</id>
<content type='text'>
Includes REFERENCE.md ToC fixes for MODULES-8183.
</content>
</entry>
<entry>
<title>(maint) Fix rubocop errors</title>
<updated>2021-08-17T16:46:58+00:00</updated>
<author>
<name>Josh Cooper</name>
<email>joshcooper@users.noreply.github.com</email>
</author>
<published>2021-08-17T16:46:58+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=54db10d91bb5da04f8f4fb9d66138aba9e5e38a4'/>
<id>urn:sha1:54db10d91bb5da04f8f4fb9d66138aba9e5e38a4</id>
<content type='text'>
Took the safest route and disabled cops either globally in .rubocop.yml
for just for specific cases in lib/
</content>
</entry>
<entry>
<title>(MODULES-10852) Fix warnings introduced by Ruby 2.7</title>
<updated>2020-10-29T14:35:44+00:00</updated>
<author>
<name>Luchian Nemes</name>
<email>luchian.nemes@puppet.com</email>
</author>
<published>2020-10-29T14:08:54+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=ae6c3499669c11aa3a7bd5b021ac64c033a2bed9'/>
<id>urn:sha1:ae6c3499669c11aa3a7bd5b021ac64c033a2bed9</id>
<content type='text'>
Ruby 2.7 introduced a warning for checking an Integer against a regular
expression because this check always returns nil even though as a string
it would respect the given regular expression.
</content>
</entry>
<entry>
<title>(MODULES-7786) Allow leading zeroes for cron params</title>
<updated>2020-08-10T12:44:35+00:00</updated>
<author>
<name>Dorin Pleava</name>
<email>dorin.pleava@puppet.com</email>
</author>
<published>2020-08-06T12:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=29925fb28a09075ea4c4105674dca2415e1c7800'/>
<id>urn:sha1:29925fb28a09075ea4c4105674dca2415e1c7800</id>
<content type='text'>
When applying a cron manigest that contains leading zeroes in a periodic
attribute (hour, minute, month, monthday, weekday), puppet will strip
down the zeroes even if they are accepted by the system cron.

Now puppet will only convert to integer the periodic attributes when
validating them, but will not change the input from the manifest.
</content>
</entry>
<entry>
<title>Merge pull request #31 from Bouke/patch-1</title>
<updated>2020-05-06T12:27:37+00:00</updated>
<author>
<name>Gabriel Nagy</name>
<email>gabrielnagy@me.com</email>
</author>
<published>2020-05-06T12:27:37+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=273991657d2fea239ef7b6be5a40a728ad507772'/>
<id>urn:sha1:273991657d2fea239ef7b6be5a40a728ad507772</id>
<content type='text'>
Day ranges can only be numeric</content>
</entry>
<entry>
<title>(MODULES-8603) Ignore .keep_* files</title>
<updated>2020-05-06T12:00:21+00:00</updated>
<author>
<name>Ewoud Kohl van Wijngaarden</name>
<email>ewoud@kohlvanwijngaarden.nl</email>
</author>
<published>2018-12-08T12:42:23+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=196dea8289d126aaf9a011a15b348fde0d5159d5'/>
<id>urn:sha1:196dea8289d126aaf9a011a15b348fde0d5159d5</id>
<content type='text'>
On Gentoo there's always a .keep_&lt;package&gt;-&lt;slot&gt; (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.
</content>
</entry>
<entry>
<title>Day ranges can only be numeric</title>
<updated>2020-04-22T19:36:13+00:00</updated>
<author>
<name>Bouke Haarsma</name>
<email>bouke@haarsma.eu</email>
</author>
<published>2020-04-22T19:36:13+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=b3e1e41ca72db2b11c047923aec7ddd274fe1779'/>
<id>urn:sha1:b3e1e41ca72db2b11c047923aec7ddd274fe1779</id>
<content type='text'>
</content>
</entry>
<entry>
<title>(PUP-9697) Updated crontab read path for Solaris</title>
<updated>2019-06-13T11:17:17+00:00</updated>
<author>
<name>Sebastian Miclea</name>
<email>sebastian.miclea@puppet.com</email>
</author>
<published>2019-06-13T11:17:17+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=712b494636e27b176bb1453b13b66ce1f6277607'/>
<id>urn:sha1:712b494636e27b176bb1453b13b66ce1f6277607</id>
<content type='text'>
</content>
</entry>
<entry>
<title>(MODULES-7789) Port over the PUP-9217 changes</title>
<updated>2019-01-09T16:48:20+00:00</updated>
<author>
<name>Enis Inan</name>
<email>enis.inan@puppet.com</email>
</author>
<published>2018-12-13T10:11:39+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=a369886d68aa84a14defd3e594aa75cab71da328'/>
<id>urn:sha1:a369886d68aa84a14defd3e594aa75cab71da328</id>
<content type='text'>
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
</content>
</entry>
</feed>
