From b804573baaa882978e6df802dc9171a12ed7c5b4 Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 19 Mar 2007 17:42:17 +0000 Subject: Changing notify to default to its message being its name git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2317 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/type/notify.rb | 58 ++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 28 deletions(-) (limited to 'lib') diff --git a/lib/puppet/type/notify.rb b/lib/puppet/type/notify.rb index a51397d48..8877e3398 100644 --- a/lib/puppet/type/notify.rb +++ b/lib/puppet/type/notify.rb @@ -4,41 +4,43 @@ module Puppet newtype(:notify) do - @doc = "Sends an arbitrary message to the puppetd run-time log." - - newproperty(:message) do - desc "The message to be sent to the log." - def sync - case @parent["withpath"] - when :true: - log(self.should) - else - Puppet.send(@parent[:loglevel], self.should) + @doc = "Sends an arbitrary message to the puppetd run-time log." + + newproperty(:message) do + desc "The message to be sent to the log." + def sync + case @parent["withpath"] + when :true: + log(self.should) + else + Puppet.send(@parent[:loglevel], self.should) + end + return end - return - end - def retrieve - return - end + def retrieve + return + end + + def insync? + false + end - def insync? - false + defaultto { @parent[:name] } end - end - newparam(:withpath) do - desc "Whether to not to show the full object path. Sends the - message at the current loglevel." - defaultto :true + newparam(:withpath) do + desc "Whether to not to show the full object path. Sends the + message at the current loglevel." + defaultto :false - newvalues(:true, :false) - end + newvalues(:true, :false) + end - newparam(:name) do - desc "An arbitrary tag for your own reference; the name of the message." - isnamevar - end + newparam(:name) do + desc "An arbitrary tag for your own reference; the name of the message." + isnamevar + end end end -- cgit