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

Bug #2347

when absent parameter is set on file type, it fails if the user parameter is a non-existing user

Added by micah - almost 5 years ago. Updated almost 5 years ago.

Status:AcceptedStart date:06/17/2009
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:file
Target version:-
Affected Puppet version:0.24.8 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

If you are trying to remove a file by specifying the absent parameter, and there is also a user parameter attached with a non-existing user, it fails… but only when the file exists. Observe:

/tmp$ cat foo.pp 
file { '/tmp/ffo': ensure => absent, owner => nonexisting_user; }
/tmp$ puppet foo.pp
/tmp$ echo $?
0
/tmp$

but, if the file exists then you get a failure:

/tmp$ touch ffo
/tmp$ puppet foo.pp
err: //File[/tmp/ffo]: Failed to retrieve current state of resource: Could not find user nonexisting_user

This makes it difficult to remove a user and a file all in one swoop, such as in the case when you want to remove any resource managed within any define that you set to absent.

History

#1 Updated by James Turnbull almost 5 years ago

  • Category set to file
  • Status changed from Unreviewed to Accepted
  • Assignee set to Luke Kanies

Luke? This weird but I can sort of see how it might happen.

#2 Updated by Luke Kanies almost 5 years ago

  • Assignee deleted (Luke Kanies)

Yeah, I can see how it would happen.

Clearly we should only be validating the presence of the user if we’re not deleting the file.

Oh for a state machine…

Also available in: Atom PDF