On Tuesday, January 22, 2013 6:40:29 PM UTC+1, Andy Parker wrote:
>
> On Tue, Jan 22, 2013 at 8:04 AM, <[email protected] <javascript:>> wrote:
>
>> Hi,
>>
>> is there a way to skip or ignore those change-events that log a 
>> pre-defined message?
>> Example:
>> I want to change some file permissions but the files must not exist.
>> When the file exists, check the permissions and change it when necessary. 
>> If it doesn't exist simply skip it, neither log or show an error nor log a 
>> message like "mode '' changed to 0644".
>>
>> I played a bit with the change_to_s, should_to_s, is_to_s methods but it 
>> just prints an empty line when I just return "nil" or when I leave the 
>> method empty.
>> Is there any way to do that?
>
>
> Off the top of my head, I'm not sure. However, I wonder why you want to 
> leave out these messages. It seems like having a report contain the 
> information that a file permission was not set because the file did not 
> exist would be useful to know.
>
> Being able to even be in this situation makes me wonder if there is a 
> mismatch in the modeling of the system you are trying to do with your type. 
> The situation you describe sounds to be as if you have a partially managed 
> resource (this file that can or cannot exist) and a type that is trying to 
> manage part of one resource as well as its own resource.
>  
>
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Puppet Developers" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/puppet-dev/-/3LjzI_MfuwgJ.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> To unsubscribe from this group, send email to 
>> [email protected] <javascript:>.
>> For more options, visit this group at 
>> http://groups.google.com/group/puppet-dev?hl=en.
>>
>
>  Hi Andy,

you're right, this is a partially managed resource.
We have a lot of machines with different Distributions and some of those 
may or may not have a specific file and we just want to make sure that the 
permissions are properly set *when* it exists.
We don't want to Manage those files/packages.

I am pretty sure there are more cases where it could make sense to just 
skip the message. A smilar case could be 
http://projects.puppetlabs.com/issues/18665

-- 
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].
Visit this group at http://groups.google.com/group/puppet-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to