summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/interpreter.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-10-09 10:54:21 -0500
committerLuke Kanies <luke@madstop.com>2007-10-09 10:54:21 -0500
commit32753e11d9cd731760ec8ba3c4f1ad2e3402535e (patch)
tree0b6375bdefa041a7d4fbab9745ed084fb025bc30 /lib/puppet/parser/interpreter.rb
parentafa1dee5eb3a8b5249715e61f9894b04ab34a6ae (diff)
parent01f132d8b88467dfd314ad355f1cdf9f546945b3 (diff)
downloadpuppet-32753e11d9cd731760ec8ba3c4f1ad2e3402535e.tar.gz
puppet-32753e11d9cd731760ec8ba3c4f1ad2e3402535e.tar.xz
puppet-32753e11d9cd731760ec8ba3c4f1ad2e3402535e.zip
Merge branch 'master' of git://michaelobrien.info/puppet into michael
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
-rw-r--r--lib/puppet/parser/interpreter.rb26
1 files changed, 4 insertions, 22 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index 0b8c035ba..87513cb18 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -14,7 +14,6 @@ class Puppet::Parser::Interpreter
include Puppet::Util
attr_accessor :usenodes
- attr_accessor :code, :file
include Puppet::Util::Errors
@@ -26,21 +25,11 @@ class Puppet::Parser::Interpreter
# evaluate our whole tree
def compile(node)
raise Puppet::ParseError, "Could not parse configuration; cannot compile" unless env_parser = parser(node.environment)
- return Puppet::Parser::Compile.new(node, env_parser, :ast_nodes => usenodes?).compile
+ return Puppet::Parser::Compile.new(node, env_parser).compile
end
# create our interpreter
- def initialize(options = {})
- if @code = options[:Code]
- elsif @file = options[:Manifest]
- end
-
- if options.include?(:UseNodes)
- @usenodes = options[:UseNodes]
- else
- @usenodes = true
- end
-
+ def initialize
# The class won't always be defined during testing.
if Puppet[:storeconfigs]
if Puppet.features.rails?
@@ -53,21 +42,14 @@ class Puppet::Parser::Interpreter
@parsers = {}
end
- # Should we parse ast nodes?
- def usenodes?
- defined?(@usenodes) and @usenodes
- end
-
private
# Create a new parser object and pre-parse the configuration.
def create_parser(environment)
begin
parser = Puppet::Parser::Parser.new(:environment => environment)
- if self.code
- parser.string = self.code
- elsif self.file
- parser.file = self.file
+ if code = Puppet.settings.value(:code, environment) and code != ""
+ parser.string = code
else
file = Puppet.settings.value(:manifest, environment)
parser.file = file