diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-13 11:24:22 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-13 11:24:22 -0600 |
| commit | ffb4c2dbc7314b364d25e4f7be599ef05b767b44 (patch) | |
| tree | 819cdb29053d004cfab70a22ea95a576b1608df7 /lib/puppet/network | |
| parent | b65fb8316e10fb31c4ac9d0af75bb3e7f452d312 (diff) | |
| download | puppet-ffb4c2dbc7314b364d25e4f7be599ef05b767b44.tar.gz puppet-ffb4c2dbc7314b364d25e4f7be599ef05b767b44.tar.xz puppet-ffb4c2dbc7314b364d25e4f7be599ef05b767b44.zip | |
This commit is the first run at removing all global
references to resources. It deprecates the class-level
[] and []= methods, used for so long to provide closure
behaviour but now unnecessary with the node configuration's
ability to function as a resource container.
All of the spec tests pass, but there is much to do to make
the test/ tests pass, I expect.
Diffstat (limited to 'lib/puppet/network')
| -rw-r--r-- | lib/puppet/network/client/master.rb | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index ea351ddc3..2b0c99d33 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -49,6 +49,15 @@ class Puppet::Network::Client::Master < Puppet::Network::Client Puppet.settings[:dynamicfacts].split(/\s*,\s*/).collect { |fact| fact.downcase } end + # Add our default resources to the configuration. + def add_default_resources(configuration) + # First create the default scheduling objects + Puppet::Type.type(:schedule).add_default_schedules(configuration) + + # And filebuckets + Puppet::Type.type(:filebucket).add_default_filebucket(configuration) + end + # Cache the config def cache(text) Puppet.info "Caching configuration at %s" % self.cachefile @@ -69,7 +78,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client def clear @configuration.clear(true) if @configuration Puppet::Type.allclear - mkdefault_objects @configuration = nil end @@ -190,6 +198,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client # Keep the state database up to date. @configuration.host_config = true + + add_default_resources(@configuration) end # A simple proxy method, so it's easy to test. @@ -204,17 +214,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client self.class.instance = self @running = false - - mkdefault_objects - end - - # Make the default objects necessary for function. - def mkdefault_objects - # First create the default scheduling objects - Puppet::Type.type(:schedule).mkdefaultschedules - - # And filebuckets - Puppet::Type.type(:filebucket).mkdefaultbucket end # Mark that we should restart. The Puppet module checks whether we're running, @@ -582,6 +581,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client clear return false end + + add_default_resources(@configuration) return true end end |
