Hello,
We have a custom type that works well with puppet 0.24.8 but fails
with puppet 0.25.4
The failure message is : "Global resource access is deprecated"
In the type, we want to create a directory that may already have
been defined elsewhere so we're using code like this :
directory = "path_to_some_directory"
if Puppet::Type.type(:file)[directory] != nil
self.debug("Directory \"#{directory}\" is already managed,
nothing to do")
else
directory_type = Puppet::Type.type(:file).create(:name =>
directory, :ensure => "directory")
end
It works with puppet 0.24.8, but not with puppet 0.25.4, so we
tried this (inspired by the solution to issue
http://projects.puppetlabs.com/issues/2768)
:
directory = "path_to_some_directory"
if resource.catalog.resource(:file, directory)
self.debug("Directory \"#{directory}\" is already managed,
nothing to do")
else
directory_type = Puppet::Type.type(:file).create(:name =>
directory, :ensure => "directory")
end
It works with puppet 0.25.4, but the test is actually never equal
to true. The creation is done twice with the same directory and Puppet
does not complain.
Is it a Puppet bug or normal behavior ? Should we just drop the
test ? Is there any recommend/better way to do this ?
Thanks for your help
Nicolas
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" 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-users?hl=en.