diff options
| author | Luke Kanies <luke@madstop.com> | 2007-10-05 11:46:35 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-10-05 11:46:35 -0500 |
| commit | 9c58c476c2ffcf9613f14e5881b1177f01d413a7 (patch) | |
| tree | 8791274ce754f486f039ba942e3a5d3d9939df3e /lib/puppet/parser/interpreter.rb | |
| parent | d35cd947c82ba9da8ec798100a3c710c34492521 (diff) | |
| download | puppet-9c58c476c2ffcf9613f14e5881b1177f01d413a7.tar.gz puppet-9c58c476c2ffcf9613f14e5881b1177f01d413a7.tar.xz puppet-9c58c476c2ffcf9613f14e5881b1177f01d413a7.zip | |
Adding a :code setting for specifying code to run
instead of a manifest, and removing all of the ambiguity
around whether an interpreter gets its own file specified
or uses the central setting.
Most of the changes are around fixing existing tests to use this new system.
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
| -rw-r--r-- | lib/puppet/parser/interpreter.rb | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 8c727118c..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 @@ -30,17 +29,7 @@ class Puppet::Parser::Interpreter 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? @@ -59,10 +48,8 @@ class Puppet::Parser::Interpreter 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 |
