Issue #5211 has been updated by James Turnbull.

Target version changed from 2.7.x to 2.7.0


----------------------------------------
Bug #5211: Augeas resource type match size != operator does not work properly
https://projects.puppetlabs.com/issues/5211

Author: Steve Nielsen
Status: Closed
Priority: High
Assignee: 
Category: augeas
Target version: 2.7.0
Affected Puppet version: 2.6.2
Keywords: communitypatch
Branch: https://github.com/bkearney/puppet/tree/ticket/2.6.2/5211


The '!=' comparator in the Augeas resource type (specifically with onlyif match 
size) does not work properly in puppet due to the underlying Ruby interpreter 
not supporting '!=' with send. Here is thread discussing the ruby issue: 
http://www.ruby-forum.com/topic/174382.  The thread seems to indicate that Ruby 
versions greater than 1.9 support it '!=' with send but I have not tested this.

I am using puppet 2.6.2 with ruby 1.8.5 on CentOS 5.5.

Puppet code that illustrates the problem:

<pre>
augeas {
  "grub":
    context => "/files/etc/grub.conf",
    onlyif => "match timeout[.='30'] size != 1",
    changes => [
      "rm timeout",
      "ins timeout before title[1]",
      "set timeout 30",
    ],
}
</pre>

With the code snippet above, puppet will execute the augeas statements on every 
run despite "timeout 30" line being present in the grub.conf file.

Attached is a patch against puppet 2.6.2.

I also notice there are no debug() statements in process_match().  Might be 
useful to have a couple statements in there to at least indicate that the 
onlyif/match statement is being processed.

I think this issue should be fixed sooner than later because it makes it that 
much harder and frustrating to debug the augeas resource type when the 
underlying implementation does not work.

Thanks,
Steve



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to