summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/indirector/catalog/compiler.rb6
-rw-r--r--lib/puppet/parser/interpreter.rb16
2 files changed, 7 insertions, 15 deletions
diff --git a/lib/puppet/indirector/catalog/compiler.rb b/lib/puppet/indirector/catalog/compiler.rb
index 4f6b0602a..ecb1c74e1 100644
--- a/lib/puppet/indirector/catalog/compiler.rb
+++ b/lib/puppet/indirector/catalog/compiler.rb
@@ -49,6 +49,7 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
def initialize
set_server_facts
+ setup_database_backend if Puppet[:storeconfigs]
end
# Create/return our interpreter.
@@ -163,6 +164,11 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
end
end
+ def setup_database_backend
+ raise Puppet::Error, "Rails is missing; cannot store configurations" unless Puppet.features.rails?
+ Puppet::Rails.init
+ end
+
# Mark that the node has checked in. LAK:FIXME this needs to be moved into
# the Node class, or somewhere that's got abstract backends.
def update_node_check(node)
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index bc0ae4fdf..1b158209d 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -17,11 +17,6 @@ class Puppet::Parser::Interpreter
include Puppet::Util::Errors
- # Determine the configuration version for a given node's environment.
- def configuration_version(node)
- parser(node.environment).version
- end
-
# evaluate our whole tree
def compile(node)
raise Puppet::ParseError, "Could not parse configuration; cannot compile on node %s" % node.name unless env_parser = parser(node.environment)
@@ -35,15 +30,6 @@ class Puppet::Parser::Interpreter
# create our interpreter
def initialize
- # The class won't always be defined during testing.
- if Puppet[:storeconfigs]
- if Puppet.features.rails?
- Puppet::Rails.init
- else
- raise Puppet::Error, "Rails is missing; cannot store configurations"
- end
- end
-
@parsers = {}
end
@@ -61,7 +47,7 @@ class Puppet::Parser::Interpreter
# Create a new parser object and pre-parse the configuration.
def create_parser(environment)
begin
- parser = Puppet::Parser::Parser.new(:environment => environment)
+ parser = Puppet::Parser::Parser.new(environment)
if code = Puppet.settings.uninterpolated_value(:code, environment) and code != ""
parser.string = code
else