summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/client
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-19 01:36:48 -0600
committerLuke Kanies <luke@madstop.com>2007-11-19 01:36:48 -0600
commit2b14f627aca1d5be69cf6606044df4d6e67f6eba (patch)
treea20db3a608af483f598f482e743868413da8fd8f /lib/puppet/network/client
parent9cf477b6cc771eab7bd29d18c49128571e877987 (diff)
downloadpuppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.gz
puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.tar.xz
puppet-2b14f627aca1d5be69cf6606044df4d6e67f6eba.zip
Reverting the changes I'd made toward removing the global
resources. These are commits: c19835ce9f8a5138b30a1a32ca741c996b0916d2 9290cc89a2206fb5204578f8e91208857a48b147 ffb4c2dbc7314b364d25e4f7be599ef05b767b44
Diffstat (limited to 'lib/puppet/network/client')
-rw-r--r--lib/puppet/network/client/master.rb28
1 files changed, 12 insertions, 16 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index 691681f9e..ea351ddc3 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -69,6 +69,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
def clear
@configuration.clear(true) if @configuration
Puppet::Type.allclear
+ mkdefault_objects
@configuration = nil
end
@@ -189,8 +190,6 @@ 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.
@@ -205,6 +204,17 @@ 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,
@@ -549,18 +559,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
private
- # Add our default resources to the configuration.
- def add_default_resources(configuration)
- # These are the only two resource types with default resources.
- # We should probably iterate across all of them, but I think that's
- # unnecessarily expensive at this point.
- [:schedule, :filebucket].each do |resource_type|
- Puppet::Type.type(resource_type).create_default_resources.each do |resource|
- configuration.add_resource(resource) unless configuration.resource(resource_type, resource.title)
- end
- end
- end
-
# Use our cached config, optionally specifying whether this is
# necessary because of a failure.
def use_cached_config(because_of_failure = false)
@@ -584,8 +582,6 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
clear
return false
end
-
- add_default_resources(@configuration)
return true
end
end