Issue #14599 has been updated by Moses Mendoza.

Status changed from Merged - Pending Release to Closed
Target version set to 2.7.19

Released in 2.7.19rc1.
----------------------------------------
Bug #14599: file resource should handle ENOTDIR
https://projects.puppetlabs.com/issues/14599#change-68161

Author: Christopher Wood
Status: Closed
Priority: Normal
Assignee: Stefan Schulte
Category: file
Target version: 2.7.19
Affected Puppet version: 2.7.13
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/805


In the "def stat" portion of the file type's file.rb, ENOTDIR (see stat(2)) 
isn't handled. This leads to the following:

$ cat /tmp/t1.pp
file { '/tmp/xx/yy/zz/1':
  ensure => absent,
}
$ ls /tmp/xx
ls: cannot access /tmp/xx: No such file or directory
$ puppet apply /tmp/t1.pp
notice: Finished catalog run in 0.02 seconds
$ touch /tmp/xx
$ puppet apply /tmp/t1.pp
err: /Stage[main]//File[/tmp/xx/yy/zz/1]: Could not evaluate: Not a directory - 
/tmp/xx/yy/zz/1
notice: Finished catalog run in 0.02 seconds

Mailing list discussion:

https://groups.google.com/forum/#!topic/puppet-users/4rk31Q1IzNY/discussion

Editorially:

I'm sure what *should* be happening here when there's ENOTDIR. On the one hand 
it seems that the ensure => absent portion above should sensibly return success 
because the full path doesn't exist. In this case an ENOTDIR indicates success. 
On the other hand, if I expected only directories in my path but there was a 
non-directory inode, perhaps I need to re-examine my assumptions about the 
system in question. In this case ENOTDIR indicates a problem.




-- 
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