theforeman / theforeman/puppet-puppet
incorrect handle of runinterval in agent/service/systemd.pp breaks catalog compilation
Nobody has claimed this yet.
- Dominant language
- Puppet
- Stars
- 97
- Forks
- 243
- Avg merge
- 8h 17m
- Merged PRs (30d)
- 1
Description
The runinterval parameter accepts values which match /^\d+[smhdy]?$/] pattern, so you can set 15m as value instead of 900.
But, when you set it to 15m as example you get a compilation error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, 'extlib::ip_to_cron' parameter 'runinterval' expects an Integer value, got String (file: /etc/puppetlabs/code/environments/dev/modules/puppet/manifests/agent/service/systemd.pp, line: 10, column: 14) on node puppetserver-003.puppetserver.local1.local.vagrant.dev.foo.com
This happens because runinterval is passed to extlibip_to_cron without making sure it is an integer.
I see this as a bug in puppet::agent::service::systemd class. The only workaround is to set runinterval to integer.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in manifests/agent/service/systemd.pp at line 10, where runinterval is passed to extlib::ip_to_cron. Reproduce catalog compilation with a value such as 15m and inspect the parameter handling. Done means the catalog compiles for the documented runinterval forms without breaking integer values.
Written by the indexing model from the issue text.
Assessment
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100