On Sep 24, 2009, at 3:07 AM, Marc Fournier wrote:
>
>>
>> The ending slash in resource file name gets stripped off by the
>> File.split operation in munge(). This patch adds it back again.
>>
>
> Duritong and I just realized that this patch introduces another
> regression. It
> would now be possible to have a duplicate definition this way:
>
> file { "foobar1":
> ensure => directory,
> path => "/tmp/dir4/",
> mode => 0666
> }
> file { "foobar2":
> ensure => directory,
> path => '/tmp/dir4',
> mode => 0600
> }
>
> The problem we have is that this example doesn't behave as one would
> expect
> starting from commit cc09c1af:
>
> file { "/tmp/dir3/": ensure => directory }
> file { "/tmp/dir3/file3": ensure => present, require => File["/tmp/
> dir3/"] }
>
> Maybe a better approach would be to emit a warning when a resource
> with a
> trailing slash in its name gets defined ? Or internally adding the
> user defined
> name as an alias so we have both filenames available, the original
> one and
> another without the trailing slash ?
>
> What do you think ?
Yeah, you're running into the issue mentioned in the related ticket -
we need to just not consider the trailing slashes, rather than
requiring them, retaining them, or what.
I think it's more complicated to fix this than we'd like -- we need a
class-level (i.e., for Puppet::Type::File) title munging method to
make this consistent, and then the Puppet::Resource::Reference class
needs to use this method to normalize the file names, so that /foo/
bar/ is considered equal to /foo/bar.
--
Meeting, n.:
An assembly of people coming together to decide what person or
department not represented in the room must solve a problem.
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---