On Tue, Jan 22, 2013 at 8:04 AM, <[email protected]> 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].
> 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.
>

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

Reply via email to