Issue #2675 has been updated by Marc Fournier.

Status changed from Closed to Re-opened

I just tried to update my puppetmaster to 0.25.2rc2, and another variant of
this bug resurfaced.  Now every client, even those < 0.25, fail with this
error:

<pre>
info: Retrieving plugins
info: Retrieving facts
err: Could not retrieve catalog: Could not find resource File[/etc/pki/] when 
converting to resource resources on node host.example.com
[...]
</pre>

The resource triggering the error is quite simple:
<pre>
file { ["/etc/pki/", "/etc/pki/rpm-gpg/"]:
  ensure => directory,
}
</pre>

Rewriting it like this solves the problem:
<pre>
file { ["/etc/pki", "/etc/pki/rpm-gpg"]:
  ensure => directory,
}
</pre>

As I have dozens of resources ending with a slash, my initial question was:
should people edit every "file" resource ending with a slash and stripping
it off ?  Or should puppet treat File["/etc/pki"] and File["/etc/pki/"] as
the same ?


Using the 3 demo files described in the inital report can be used to
reproduce the error:
<pre>
$ puppet test1.pp 
notice: //File[/tmp/dir1]/ensure: created
notice: //File[/tmp/dir1/file1]/ensure: created

$ puppet test2.pp 
Could not find resource File[/tmp/dir2/] when converting to resource resources 
on node host.example.com

$ puppet test3.pp 
Could not find resource File[/tmp/dir3/] when converting to resource resources 
on node host.example.com
</pre>

----------------------------------------
Bug #2675: ending slash in directory name gets stripped off
http://projects.reductivelabs.com/issues/2675

Author: Marc Fournier
Status: Re-opened
Priority: Low
Assigned to: Markus Roberts
Category: file
Target version: 0.25.2
Affected version: 0.25.1rc2
Keywords: 
Branch: http://github.com/MarkusQ/puppet/tree/ticket/0.25.x/2675


I just noticed this error on 0.25.x. It used to work on 0.24.8.

<pre>
$ cat /tmp/test1.pp
file { "/tmp/dir1":       ensure => directory }
file { "/tmp/dir1/file1": ensure => present, require => File["/tmp/dir1"] }

$ cat /tmp/test2.pp
file { "/tmp/dir2/":      ensure => directory }
file { "/tmp/dir2/file2": ensure => present, require => File["/tmp/dir2"] }

$ cat /tmp/test3.pp
file { "/tmp/dir3/":      ensure => directory }
file { "/tmp/dir3/file3": ensure => present, require => File["/tmp/dir3/"] }

$ puppet /tmp/test1.pp
notice: //File[/tmp/dir1]/ensure: created
notice: //File[/tmp/dir1/file1]/ensure: created

$ puppet /tmp/test2.pp
notice: //File[/tmp/dir2]/ensure: created
notice: //File[/tmp/dir2/file2]/ensure: created

$ puppet /tmp/test3.pp
Could not find dependency File[/tmp/dir3/] for File[/tmp/dir3/file3] at 
/tmp/test3.pp:2
</pre>

I think I have a working patch. I'll submit it in a few minutes.


-- 
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://reductivelabs.com/redmine/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