diff options
author | Luke Kanies <luke@madstop.com> | 2009-02-10 15:18:30 -0600 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-02-11 09:11:31 +1100 |
commit | 32c2be926795ce3ce68f573367f7700e87ac8416 (patch) | |
tree | ae52417826c45d25876f06affe5e1d5e4fbd1eb0 /lib/puppet | |
parent | 0e491591d2ab88938f9b127dd8c26033e817eb1a (diff) | |
download | puppet-32c2be926795ce3ce68f573367f7700e87ac8416.tar.gz puppet-32c2be926795ce3ce68f573367f7700e87ac8416.tar.xz puppet-32c2be926795ce3ce68f573367f7700e87ac8416.zip |
Fixed #1884 - exported defines are collected by the exporting host
This was caused by the fix to #1472. That fix unexported
any resources collected from the local catalog.
The crux of this fix is that it separates 'exported'
and 'virtual' a bit more. It also removes no-longer-needed
functionality where resources copied their virtual or
exported bits from the enclosing define or class. This is
now obsolete because we don't evaluate virtual defined resources.
The crux of this commit is that defined resources can stay
exported even though they're evaluated, and that exported state
won't inherit to contained resources such that those then don't
get evaluated.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/parser/ast/resource.rb | 3 | ||||
-rw-r--r-- | lib/puppet/parser/collector.rb | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/puppet/parser/ast/resource.rb b/lib/puppet/parser/ast/resource.rb index eb0bdeac4..d222893b3 100644 --- a/lib/puppet/parser/ast/resource.rb +++ b/lib/puppet/parser/ast/resource.rb @@ -32,8 +32,7 @@ class Resource < AST::ResourceReference # because sometimes the :virtual attribute is set *after* # :exported, in which case it clobbers :exported if :exported # is true. Argh, this was a very tough one to track down. - exp = self.exported || scope.resource.exported? - virt = self.virtual || scope.resource.virtual? || exp + virt = self.virtual || self.exported # This is where our implicit iteration takes place; if someone # passed an array as the name, then we act just like the called us diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index 0f9072510..bcba9528e 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -72,8 +72,7 @@ class Puppet::Parser::Collector def collect_exported # First get everything from the export table. Just reuse our # collect_virtual method but tell it to use 'exported? for the test. - resources = collect_virtual(true).reject { |r| ! r.virtual? }.each { |r| r.exported = false } - #resources = collect_virtual(true).reject { |r| ! r.virtual? } + resources = collect_virtual(true).reject { |r| ! r.virtual? } count = resources.length |