diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 17:42:17 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 17:42:17 +0000 |
commit | b804573baaa882978e6df802dc9171a12ed7c5b4 (patch) | |
tree | 3d7264730b40345fbd4be21d170c8e01ecbeba6f /lib | |
parent | e2c5dbb2cc022034a54b1207310eff43be93ce85 (diff) | |
download | puppet-b804573baaa882978e6df802dc9171a12ed7c5b4.tar.gz puppet-b804573baaa882978e6df802dc9171a12ed7c5b4.tar.xz puppet-b804573baaa882978e6df802dc9171a12ed7c5b4.zip |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/type/notify.rb | 58 |
1 files changed, 30 insertions, 28 deletions
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 |