The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #14105

aug object is closed on need_to_run but is neede after that in execute_changes.

Added by Jorge Eduardo Cardona about 2 years ago. Updated about 1 year ago.

Status:AcceptedStart date:04/19/2012
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Doh!
Target version:3.x
Affected Puppet version: Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

First I’m using Debian with puppet 2.7.13-1 and libaugeas0 0.9.0-1, and ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

I’m just trying to set some sudoers settings but fails with this behavior:

1) need_to_run is called and it calls the method close at the end because @aug.save returns a nil, and everyone knows that not nil is true ;) 2) after that the execute_changes method needs the @aug object but is not there then fails with a “change from need_to_run to 0 failed: undefined method `match' for nil:NilClass”

I commented the all the code in the conditional in provider/augeas/augeas.rb with the “if not return_value or resource.noop? or not save_result”, then close is not called and works perfectly, I don’t really know what is going on since http://augeas.net/docs/api.html says that save must return 0 or 1.

Maybe I’m skipping something obvious here, but the augeas code runs perfectly using augtool, so. I have no idea what it is, and this seems as a bug for me.

Hope this can help.

Greetings.


Related issues

Related to Puppet - Refactor #18569: Implement "whiny nil" for Puppet, solve `Undefined method... Rejected

History

#1 Updated by Jorge Eduardo Cardona about 2 years ago

Oo, I’m using force, then save_result is never defined since that is inside the “unless force” block. Setting save_result = true at the beginning of need_to_run will solve this.

#2 Updated by Daniel Pittman about 2 years ago

  • Category set to Doh!
  • Status changed from Unreviewed to Accepted

#3 Updated by Daniel Pittman about 2 years ago

  • Target version set to 3.x

#4 Updated by Jorge Eduardo Cardona about 2 years ago

First time on ruby so, but here is it: https://github.com/puppetlabs/puppet/pull/699 with rspec (I like it but didn’t like the global variables everywhere.)

#5 Updated by Daniel Pittman over 1 year ago

Looking at the code in master, it looks like this problem is solved. Can you confirm that?

#6 Updated by Adrien Thebo about 1 year ago

I’ve looked at this code and while it isn’t clear if the issue is resolved in master, the tests don’t seem to cover the behavior change. Since there hasn’t been an update on the pull request or this ticket i’m going to close the pull request.

Also available in: Atom PDF