diff options
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/collector.rb | 6 | ||||
-rw-r--r-- | lib/puppet/parser/grammar.ra | 4 | ||||
-rw-r--r-- | lib/puppet/parser/parser.rb | 8 |
3 files changed, 12 insertions, 6 deletions
diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index 2699dc6e1..bcba9528e 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -6,6 +6,12 @@ class Puppet::Parser::Collector # Call the collection method, mark all of the returned objects as non-virtual, # and then delete this object from the list of collections to evaluate. def evaluate + # Shortcut if we're not using storeconfigs and they're trying to collect + # exported resources. + if form == :exported and Puppet[:storeconfigs] != true + Puppet.warning "Not collecting exported resources without storeconfigs" + return false + end if self.resources if objects = collect_resources and ! objects.empty? return objects diff --git a/lib/puppet/parser/grammar.ra b/lib/puppet/parser/grammar.ra index 484efe83c..a2f6729ee 100644 --- a/lib/puppet/parser/grammar.ra +++ b/lib/puppet/parser/grammar.ra @@ -152,7 +152,7 @@ virtualresource: at resource { type = val[0] if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly] - error "You cannot collect without storeconfigs being set" + Puppet.warning addcontext("You cannot collect without storeconfigs being set") end if val[1].is_a? AST::ResourceDefaults @@ -193,7 +193,7 @@ collection: classref collectrhand { args[:form] = val[1] end if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly] - error "You cannot collect exported resources without storeconfigs being set" + Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored") end result = ast AST::Collection, args } diff --git a/lib/puppet/parser/parser.rb b/lib/puppet/parser/parser.rb index e27a209fc..3d7f21dca 100644 --- a/lib/puppet/parser/parser.rb +++ b/lib/puppet/parser/parser.rb @@ -29,7 +29,7 @@ module Puppet class Parser < Racc::Parser -module_eval <<'..end grammar.ra modeval..idfef5d70c9f', 'grammar.ra', 638 +module_eval <<'..end grammar.ra modeval..id9145566289', 'grammar.ra', 638 # It got too annoying having code in a file that needs to be compiled. require 'puppet/parser/parser_support' @@ -41,7 +41,7 @@ require 'puppet/parser/parser_support' # $Id$ -..end grammar.ra modeval..idfef5d70c9f +..end grammar.ra modeval..id9145566289 ##### racc 1.4.5 generates ### @@ -958,7 +958,7 @@ module_eval <<'.,.,', 'grammar.ra', 174 type = val[0] if (type == :exported and ! Puppet[:storeconfigs]) and ! Puppet[:parseonly] - error "You cannot collect without storeconfigs being set" + Puppet.warning addcontext("You cannot collect without storeconfigs being set") end if val[1].is_a? AST::ResourceDefaults @@ -1011,7 +1011,7 @@ module_eval <<'.,.,', 'grammar.ra', 199 args[:form] = val[1] end if args[:form] == :exported and ! Puppet[:storeconfigs] and ! Puppet[:parseonly] - error "You cannot collect exported resources without storeconfigs being set" + Puppet.warning addcontext("You cannot collect exported resources without storeconfigs being set; the collection will be ignored") end result = ast AST::Collection, args result |