diff options
author | ajax <ajax@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-02 16:50:05 +0000 |
---|---|---|
committer | ajax <ajax@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-02 16:50:05 +0000 |
commit | 30f9fa3134809d38e5cf397946d30bbb3622fb38 (patch) | |
tree | 41523e95154f6c52d85500e7bd1e5ac9f23041ba | |
parent | 8cc3c8a1fc6e1923b10ad2cea7bd615cd39f77d0 (diff) | |
download | puppet-30f9fa3134809d38e5cf397946d30bbb3622fb38.tar.gz puppet-30f9fa3134809d38e5cf397946d30bbb3622fb38.tar.xz puppet-30f9fa3134809d38e5cf397946d30bbb3622fb38.zip |
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
-rw-r--r-- | lib/puppet/type/notify.rb | 21 |
1 files 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 |