From 30f9fa3134809d38e5cf397946d30bbb3622fb38 Mon Sep 17 00:00:00 2001 From: ajax Date: Mon, 2 Oct 2006 16:50:05 +0000 Subject: Added parameter 'withpath' to toggle printing of the object path. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1711 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/type/notify.rb | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/puppet/type/notify.rb b/lib/puppet/type/notify.rb index 8f00d5eb5..542b5f0b4 100644 --- a/lib/puppet/type/notify.rb +++ b/lib/puppet/type/notify.rb @@ -6,13 +6,15 @@ module Puppet newtype(:notify) do @doc = "Sends an arbitrary message to the puppetd run-time log." - # - # This state - # newstate(:message) do desc "The message to be sent to the log." def sync - Puppet::info(self.should) + case @parent["withpath"] + when :true: + log(self.should) + else + Puppet::info(self.should) + end return end @@ -26,11 +28,18 @@ module Puppet end + newparam(:withpath) do + desc "Whether to not to show the full object path. If true, the message + will be sent to the client at the current loglevel. If false, + the message will be sent to the client at the info level." + defaultto :true + newvalues(:true, :false) + end + newparam(:name) do - desc "An arbitrary reference tag; the name of the message." + desc "An arbitrary tag for your own reference; the name of the message." isnamevar end - end end -- cgit