summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-24 06:37:00 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-01-24 06:37:00 +0000
commit9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec (patch)
tree02e58bed60b09dae80c5288618b233e91b64a84c /lib/puppet
parentae2575b45de1e8f4c0ec956cebe0eed2bafbcf57 (diff)
downloadpuppet-9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec.tar.gz
puppet-9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec.tar.xz
puppet-9b2afcb4c32ceeac6e008cd2ec171a2b7bdc37ec.zip
Fixing some logging issues
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@849 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/client.rb3
-rw-r--r--lib/puppet/client/master.rb1
-rw-r--r--lib/puppet/log.rb18
3 files changed, 16 insertions, 6 deletions
diff --git a/lib/puppet/client.rb b/lib/puppet/client.rb
index c6061e0ef..dcf3dd439 100644
--- a/lib/puppet/client.rb
+++ b/lib/puppet/client.rb
@@ -130,6 +130,9 @@ module Puppet
# Stick it in the loop
EventLoop.current.monitor_timer timer
+ # Run once before we start following the timer
+ self.runnow
+
# And run indefinitely
observe_signal timer, :alarm do
if self.scheduled?
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb
index f0204c418..73217b2f0 100644
--- a/lib/puppet/client/master.rb
+++ b/lib/puppet/client/master.rb
@@ -15,6 +15,7 @@ class Puppet::Client::MasterClient < Puppet::Client
# objects. For now, just descend into the tree and perform and
# necessary manipulations.
def apply
+ Puppet.notice "Beginning configuration run"
dostorage()
unless defined? @objects
raise Puppet::Error, "Cannot apply; objects not defined"
diff --git a/lib/puppet/log.rb b/lib/puppet/log.rb
index 24a694be4..65043a463 100644
--- a/lib/puppet/log.rb
+++ b/lib/puppet/log.rb
@@ -80,6 +80,10 @@ module Puppet
end
end
+ def Log.destinations
+ return @destinations.keys
+ end
+
# Yield each valid level in turn
def Log.eachlevel
@levels.each { |level| yield level }
@@ -159,11 +163,11 @@ module Puppet
end
end
- # Route the actual message. FIXME There are lots of things this method should
- # do, like caching, storing messages when there are not yet destinations,
- # a bit more.
- # It's worth noting that there's a potential for a loop here, if
- # the machine somehow gets the destination set as itself.
+ # Route the actual message. FIXME There are lots of things this method
+ # should do, like caching, storing messages when there are not yet
+ # destinations, a bit more. It's worth noting that there's a potential
+ # for a loop here, if the machine somehow gets the destination set as
+ # itself.
def Log.newmessage(msg)
if @levels.index(msg.level) < @loglevel
return
@@ -179,7 +183,9 @@ module Puppet
dest.send(msg.level, msg.to_s.gsub("%", '%%'))
else
dest.send(msg.level, "(%s) %s" %
- [msg.source.to_s.gsub("%", ""), msg.to_s.gsub("%", '%%')]
+ [msg.source.to_s.gsub("%", ""),
+ msg.to_s.gsub("%", '%%')
+ ]
)
end
when File: