summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/interpreter.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-29 17:27:30 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-29 17:27:30 +0000
commitf52e2d006fb3ae8f0b3f58deac8f4287708bdb7b (patch)
tree6693bb0cf86c1de3aed7fb2e006b53e75cc5b83f /lib/puppet/parser/interpreter.rb
parent3a313ad40521856cd9d8784b460c5403f6b4f98f (diff)
downloadpuppet-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/interpreter.rb')
-rw-r--r--lib/puppet/parser/interpreter.rb18
1 files changed, 9 insertions, 9 deletions
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