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/server/master.rb | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'lib/puppet/server') diff --git a/lib/puppet/server/master.rb b/lib/puppet/server/master.rb index 07a476efd..7e719452f 100644 --- a/lib/puppet/server/master.rb +++ b/lib/puppet/server/master.rb @@ -35,10 +35,14 @@ class Server end def initialize(hash = {}) - # FIXME this should all be s/:File/:Manifest/g or something - # build our AST - @file = hash[:File] || Puppet[:manifest] - hash.delete(:File) + args = {} + + # Allow specification of a code snippet or of a file + if code = hash[:Code] + args[:Code] = code + else + args[:Manifest] = hash[:Manifest] || Puppet[:manifest] + end if hash[:Local] @local = hash[:Local] @@ -52,19 +56,18 @@ class Server @ca = nil end - @parsecheck = hash[:FileTimeout] || 15 + args[:ParseCheck] = hash[:FileTimeout] || 15 Puppet.debug("Creating interpreter") - args = {:Manifest => @file, :ParseCheck => @parsecheck} - if hash.include?(:UseNodes) args[:UseNodes] = hash[:UseNodes] elsif @local args[:UseNodes] = false end - # This is only used by the cfengine module + # This is only used by the cfengine module, or if --loadclasses was specified + # in +puppet+. if hash.include?(:Classes) args[:Classes] = hash[:Classes] end @@ -110,7 +113,9 @@ class Server clientip = facts["ipaddress"] end - Puppet.notice("Compiling configuration for %s" % client) + unless @local + Puppet.notice("Compiling configuration for %s" % client) + end begin retobjects = @interpreter.run(client, facts) rescue Puppet::Error => detail -- cgit