Nicolas,

I think you should cross-post this to puppet-dev.

Trevor

On Thu, Apr 22, 2010 at 8:13 AM, nicolas <[email protected]> wrote:
> Could anyone help me on this topic, please ?
> Or point me to up-to-date documentation explaining the good way to do
> it ?
>
> thanks !
>
> nicolas
>
> On 19 avr, 13:56, nicolas <[email protected]> wrote:
>> 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 
>> issuehttp://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 
>> athttp://groups.google.com/group/puppet-users?hl=en.
>
> --
> 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.
>
>



-- 
Trevor Vaughan
Vice President, Onyx Point, Inc
(410) 541-6699
[email protected]

-- This account not approved for unencrypted proprietary information --

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

Reply via email to