diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-29 17:27:30 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-29 17:27:30 +0000 |
| commit | f52e2d006fb3ae8f0b3f58deac8f4287708bdb7b (patch) | |
| tree | 6693bb0cf86c1de3aed7fb2e006b53e75cc5b83f /lib/puppet/parser | |
| parent | 3a313ad40521856cd9d8784b460c5403f6b4f98f (diff) | |
| download | puppet-f52e2d006fb3ae8f0b3f58deac8f4287708bdb7b.tar.gz puppet-f52e2d006fb3ae8f0b3f58deac8f4287708bdb7b.tar.xz puppet-f52e2d006fb3ae8f0b3f58deac8f4287708bdb7b.zip | |
Trying to clean up how rails is loaded
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1989 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser')
| -rw-r--r-- | lib/puppet/parser/collector.rb | 1 | ||||
| -rw-r--r-- | lib/puppet/parser/interpreter.rb | 18 |
2 files changed, 9 insertions, 10 deletions
diff --git a/lib/puppet/parser/collector.rb b/lib/puppet/parser/collector.rb index fa7a41589..8b7df8c78 100644 --- a/lib/puppet/parser/collector.rb +++ b/lib/puppet/parser/collector.rb @@ -5,7 +5,6 @@ class Puppet::Parser::Collector # Collect exported objects. def collect_exported - require 'puppet/rails' # 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) diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 6c1c27926..ad2487f11 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -375,9 +375,12 @@ class Puppet::Parser::Interpreter end # The class won't always be defined during testing. - if Puppet[:storeconfigs] and Puppet.features.rails? - require 'puppet/rails' - Puppet::Rails.init + if Puppet[:storeconfigs] + if Puppet.features.rails? + Puppet::Rails.init + else + raise Puppet::Error, "Rails is missing; cannot store configurations" + end end @files = [] @@ -770,12 +773,9 @@ class Puppet::Parser::Interpreter # Store the configs into the database. def storeconfigs(hash) - unless defined? ActiveRecord - require 'puppet/rails' - unless defined? ActiveRecord - raise LoadError, - "storeconfigs is enabled but rails is unavailable" - end + unless Puppet.features.rails? + raise Puppet::Error, + "storeconfigs is enabled but rails is unavailable" end Puppet::Rails.init |
