diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-14 02:42:21 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-05-14 02:42:21 +0000 |
commit | ba57dff26b717113a4a7e0bb73bd099a684776e5 (patch) | |
tree | c2e701c1135c659e9fc66c900715a717410ca093 /lib/puppet/parser/interpreter.rb | |
parent | 22e70f069cec86f94e17774c9c2b84b1bb9cda6c (diff) | |
download | puppet-ba57dff26b717113a4a7e0bb73bd099a684776e5.tar.gz puppet-ba57dff26b717113a4a7e0bb73bd099a684776e5.tar.xz puppet-ba57dff26b717113a4a7e0bb73bd099a684776e5.zip |
I had to redo how the scopes handled collectable objects (which I will soon change to being called "exported objects"). All seems to work now, though.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1192 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index ee447076f..9bc1cca43 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -85,6 +85,18 @@ module Puppet @local = hash[:Local] || false + if hash.include?(:ForkSave) + @forksave = hash[:ForkSave] + else + # This is just too dangerous right now. Sorry, it's going + # to have to be slow. + @forksave = false + end + + if Puppet[:storeconfigs] + Puppet::Rails.init + end + # Create our parser object parsefiles end @@ -250,13 +262,28 @@ module Puppet Puppet::Rails.init - # We store all of the objects, even the collectable ones - benchmark(:info, "Stored configuration for #{client}") do - Puppet::Rails::Host.store( - :objects => objects, - :host => client, - :facts => facts - ) + # Fork the storage, since we don't need the client waiting + # on that. How do I avoid this duplication? + if @forksave + fork { + # We store all of the objects, even the collectable ones + benchmark(:info, "Stored configuration for #{client}") do + Puppet::Rails::Host.store( + :objects => objects, + :host => client, + :facts => facts + ) + end + } + else + # We store all of the objects, even the collectable ones + benchmark(:info, "Stored configuration for #{client}") do + Puppet::Rails::Host.store( + :objects => objects, + :host => client, + :facts => facts + ) + end end # Now that we've stored everything, we need to strip out |