From d8b4b0dbf35b2b183cd62adf591ebf4650448a0d Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 4 Apr 2006 22:23:08 +0000 Subject: adding -e ability to puppet executable git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1065 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/client/master.rb | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'lib/puppet/client') diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb index cb2d6f444..390c07220 100644 --- a/lib/puppet/client/master.rb +++ b/lib/puppet/client/master.rb @@ -26,7 +26,9 @@ 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" + unless @local + Puppet.notice "Beginning configuration run" + end dostorage() unless defined? @objects raise Puppet::Error, "Cannot apply; objects not defined" @@ -65,7 +67,9 @@ class Puppet::Client::MasterClient < Puppet::Client Metric.store Metric.graph end - Puppet.notice "Finished configuration run" + unless @local + Puppet.notice "Finished configuration run" + end return transaction end @@ -228,11 +232,7 @@ class Puppet::Client::MasterClient < Puppet::Client "Invalid returned objects of type %s" % objects.class end - if classes = objects.classes - self.setclasses(classes) - else - Puppet.info "No classes to store" - end + self.setclasses(objects.classes) # Clear all existing objects, so we can recreate our stack. if defined? @objects @@ -280,7 +280,15 @@ class Puppet::Client::MasterClient < Puppet::Client end end + # Store the classes in the classfile, but only if we're not local. def setclasses(ary) + if @local + return + end + unless ary and ary.length > 0 + Puppet.info "No classes to store" + return + end begin File.open(Puppet[:classfile], "w") { |f| f.puts ary.join("\n") -- cgit