theforeman / theforeman/puppet-puppet

incorrect handle of runinterval in agent/service/systemd.pp breaks catalog compilation

Open
#820 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.