diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-22 12:56:32 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-22 12:56:32 -0500 |
| commit | 60cd6a73b2b0cb7b26b091d4214c66eb5ed3b0ad (patch) | |
| tree | 1199cb338548abd11c3f92dd3bcb056fe69d20ce /lib/puppet/node | |
| parent | 46d69068fa7b2f3448294c5d3da21c69cef73d2f (diff) | |
| download | puppet-60cd6a73b2b0cb7b26b091d4214c66eb5ed3b0ad.tar.gz puppet-60cd6a73b2b0cb7b26b091d4214c66eb5ed3b0ad.tar.xz puppet-60cd6a73b2b0cb7b26b091d4214c66eb5ed3b0ad.zip | |
The structure for handling resource generation is now
in place, which means I'm over the hump in developing
this branch.
I have to fix some design flaws I made in the configurations,
particularly that the 'runner' handler needs to be able to
specify tags and whether to ignore schedules, but otherwise,
I think it's straightforward test- and bug-fixing from here out.
Diffstat (limited to 'lib/puppet/node')
| -rw-r--r-- | lib/puppet/node/configuration.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/puppet/node/configuration.rb b/lib/puppet/node/configuration.rb index de6e776c5..747ab9ef6 100644 --- a/lib/puppet/node/configuration.rb +++ b/lib/puppet/node/configuration.rb @@ -118,11 +118,21 @@ class Puppet::Node::Configuration < Puppet::PGraph # Create an implicit resource, meaning that it will lose out # to any explicitly defined resources. This method often returns # nil. + # The quirk of this method is that it's not possible to create + # an implicit resource before an explicit resource of the same name, + # because all explicit resources are created before any generate() + # methods are called on the individual resources. Thus, this + # method can safely just check if an explicit resource already exists + # and toss this implicit resource if so. def create_implicit_resource(type, options) unless options.include?(:implicit) options[:implicit] = true end - # LAK:FIXME catch exceptions here and return nil when problems + + # This will return nil if an equivalent explicit resource already exists. + # When resource classes no longer retain references to resource instances, + # this will need to be modified to catch that conflict and discard + # implicit resources. if resource = create_resource(type, options) resource.implicit = true |
