summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-24 19:48:22 +0000
committerLuke Kanies <luke@madstop.com>2009-04-24 14:51:34 -0500
commitbf46db7452ae72d3a40ecc5cf14ae62692c47e84 (patch)
tree20a9a9dc1ceb72b120e975329aed0ff8c5061dc4 /lib
parent5f6b5c0efe5210583a1040f902af2ff0709f3ca9 (diff)
downloadpuppet-bf46db7452ae72d3a40ecc5cf14ae62692c47e84.tar.gz
puppet-bf46db7452ae72d3a40ecc5cf14ae62692c47e84.tar.xz
puppet-bf46db7452ae72d3a40ecc5cf14ae62692c47e84.zip
Fixing rails feature test
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/defaults.rb2
-rw-r--r--lib/puppet/feature/rails.rb12
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb
index 407d2e890..bcfa83371 100644
--- a/lib/puppet/defaults.rb
+++ b/lib/puppet/defaults.rb
@@ -711,7 +711,7 @@ module Puppet
require 'puppet/node/facts'
require 'puppet/resource/catalog'
if value
- raise "StoreConfigs not supported without ActiveRecord" unless Puppet.features.rails?
+ raise "StoreConfigs not supported without ActiveRecord 2.3" unless Puppet.features.rails?
Puppet::Resource::Catalog.cache_class = :active_record unless Puppet.settings[:async_storeconfigs]
Puppet::Node::Facts.cache_class = :active_record
Puppet::Node.cache_class = :active_record
diff --git a/lib/puppet/feature/rails.rb b/lib/puppet/feature/rails.rb
index 561863c9f..bdff7893c 100644
--- a/lib/puppet/feature/rails.rb
+++ b/lib/puppet/feature/rails.rb
@@ -28,11 +28,13 @@ Puppet.features.add(:rails) do
end
end
- unless defined?(::ActiveRecord) and ::ActiveRecord::VERSION::MAJOR == 2 and ::ActiveRecord::VERSION::MINOR == 3
- Puppet.err "ActiveRecord 2.3 required for StoreConfigs"
- raise "ActiveRecord 2.3 required for StoreConfigs"
+ if ! (defined?(::ActiveRecord) and defined?(::ActiveRecord::VERSION) and defined?(::ActiveRecord::VERSION::MAJOR) and defined?(::ActiveRecord::VERSION::MINOR))
+ false
+ elsif ! ::ActiveRecord::VERSION::MAJOR == 2 and ::ActiveRecord::VERSION::MINOR == 3
+ Puppet.info "ActiveRecord 2.3 required for StoreConfigs"
+ false
+ else
+ true
end
-
- true
end