<feed xmlns='http://www.w3.org/2005/Atom'>
<title>puppet-cron_core/lib/puppet/provider/cron, 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-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>(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>
<entry>
<title>(MODULES-8306) Port over the crontab filetypes from Puppet</title>
<updated>2018-12-08T01:55:20+00:00</updated>
<author>
<name>Enis Inan</name>
<email>enis.inan@puppet.com</email>
</author>
<published>2018-12-02T00:35:32+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=e49408174d1e7662bd18f088accd8cc33d0e152c'/>
<id>urn:sha1:e49408174d1e7662bd18f088accd8cc33d0e152c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Disable Lint/EmptyWhen cop</title>
<updated>2018-08-08T16:10:19+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-08-08T16:10:19+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=570f82c8486b993c3b571ecd8712a3c0dc0f19e6'/>
<id>urn:sha1:570f82c8486b993c3b571ecd8712a3c0dc0f19e6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix Style/MultilineBlockChain violation</title>
<updated>2018-08-08T16:06:29+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-08-08T16:06:29+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=9ae4388987ec26a3de7ed75d012a734297cbd43f'/>
<id>urn:sha1:9ae4388987ec26a3de7ed75d012a734297cbd43f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix Style/GuardClause violations.</title>
<updated>2018-08-07T16:32:11+00:00</updated>
<author>
<name>Jorie Tappa</name>
<email>jorie@jorietappa.com</email>
</author>
<published>2018-08-07T16:26:43+00:00</published>
<link rel='alternate' type='text/html' href='https://cgit.fluxo.info/puppet-cron_core/commit/?id=fc267d8ebba7485ef5e6acfa19751b17f77321e4'/>
<id>urn:sha1:fc267d8ebba7485ef5e6acfa19751b17f77321e4</id>
<content type='text'>
</content>
</entry>
</feed>
