Puppet: System Administration Automated

Support

Ticket #1216 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

Parse error in crontab provider

Reported by: ctrlaltdel Assigned to: jamtur01
Priority: normal Milestone: 0.24.5
Component: cron Version: 0.24.4
Severity: normal Keywords:
Cc: francois@ctrlaltdel.ch Triage Stage: Ready for checkin
Attached Patches: Tests Complexity: Easy

Description

The crontab provider does not support crontab entries beginning with a space character although they are recognized by crond (under Debian etch but hopefully elsewhere too).

Patch available with git at ctrlaltdel/fix-for-crontab.

ctrlaltdel = http://francois.ctrlaltdel.ch/dev/puppet.git

/usr/lib/ruby/1.8/puppet/util/fileparsing.rb:240:in `parse'
/usr/lib/ruby/1.8/puppet/util/fileparsing.rb:233:in `collect'
/usr/lib/ruby/1.8/puppet/util/fileparsing.rb:233:in `parse'
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:236:in `retrieve'
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:201:in `prefetch_target'
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:176:in `prefetch'
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:175:in `each'
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:175:in `prefetch'
/usr/lib/ruby/1.8/puppet/provider/parsedfile.rb:351:in `prefetch'
/usr/lib/ruby/1.8/puppet/metatype/evaluation.rb:21:in `evaluate'
/usr/lib/ruby/1.8/puppet/transaction.rb:58:in `apply'
/usr/lib/ruby/1.8/puppet/transaction.rb:238:in `eval_resource'
/usr/lib/ruby/1.8/puppet/util.rb:445:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:444:in `thinmark'
/usr/lib/ruby/1.8/puppet/transaction.rb:237:in `eval_resource'
/usr/lib/ruby/1.8/puppet/transaction.rb:309:in `evaluate'
/usr/lib/ruby/1.8/puppet/util.rb:445:in `thinmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:444:in `thinmark'
/usr/lib/ruby/1.8/puppet/transaction.rb:308:in `evaluate'
/usr/lib/ruby/1.8/puppet/transaction.rb:302:in `collect'
/usr/lib/ruby/1.8/puppet/transaction.rb:302:in `evaluate'
/usr/lib/ruby/1.8/puppet/node/catalog.rb:118:in `apply'
/usr/lib/ruby/1.8/puppet/network/client/master.rb:264:in `run'
/usr/lib/ruby/1.8/puppet/util.rb:212:in `benchmark'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:307:in `realtime'
/usr/lib/ruby/1.8/puppet/util.rb:211:in `benchmark'
/usr/lib/ruby/1.8/puppet/network/client/master.rb:263:in `run'
/usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
/usr/lib/ruby/1.8/puppet/network/client/master.rb:245:in `run'
/usr/sbin/puppetd:439
err: //Node[XXXX.camptocamp.com]/base/puppet::client/Cron[mycron]: Failed to retrieve current state of resource: Could not parse line " */10\t\t * * * * /usr/bin/svn update /var/www/www.XXX.com/htdocs/sandbox" at root:4

Change History

05/07/08 19:02:52 changed by ctrlaltdel

Tests are also included

05/10/08 16:14:21 changed by jamtur01

Having a look at the commit the test seems to be removed not added?

05/10/08 21:50:24 changed by ctrlaltdel

There are two commits, one for the fix and the second one for the test. Did I missed something ?

francois@slayer:~/dev/puppet$ git remote show ctrlaltdel
* remote ctrlaltdel
  URL: http://francois.ctrlaltdel.ch/dev/puppet.git
  Tracked remote branches
    fix-for-crontab ssh ssh-authorized-key ssh-clean ssh2
francois@slayer:~/dev/puppet$ git checkout ctrlaltdel/fix-for-crontab
HEAD is now at 30acbf9... Tests for Bug #1216
francois@slayer:~/dev/puppet$ git log HEAD^1^1..HEAD
commit 30acbf9365c83108a0cdb00e95e44abc5c672924
Author: Francois Deppierraz <francois.deppierraz@camptocamp.com>
Date:   Wed May 7 19:00:59 2008 +0200

    Tests for Bug #1216

commit 938839419b8c086c40cf0686441b3e92892186bf
Author: Francois Deppierraz <francois.deppierraz@camptocamp.com>
Date:   Wed May 7 18:27:41 2008 +0200

    Crontab provider: fix a parse error when a line begins with a space characte
francois@slayer:~/dev/puppet$ 

05/11/08 01:16:37 changed by jamtur01

Maybe it's me - let me try to fetch again.

05/11/08 11:22:42 changed by jamtur01

  • owner changed from community to luke.
  • complexity changed from Unknown to Easy.
  • stage changed from Unreviewed to Accepted.

Okay - this seems reasonable to me. Luke assigning to you.

05/12/08 22:41:23 changed by luke

  • milestone set to 0.24.5.

05/15/08 07:18:59 changed by Fujin

  • owner changed from luke to jamtur01.
  • stage changed from Accepted to Ready for checkin.
  • patch changed from Code to Tests.

Triage

05/16/08 08:51:41 changed by jamtur01

  • status changed from new to closed.
  • resolution set to fixed.

Pushed in commit [38545d9a81274c16a43f7f19889cd12e52871d76] in branch 0.24.x