summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@reductivelabs.com>2010-01-06 16:44:48 -0800
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commit644ad7e41880fe8c9e73a099e9d6644e19828f46 (patch)
tree83c18503186ee47054abef8170a3c45b167c009a
parent9f8e0c0516421b0250454d54c935c8517170a93f (diff)
downloadpuppet-644ad7e41880fe8c9e73a099e9d6644e19828f46.tar.gz
puppet-644ad7e41880fe8c9e73a099e9d6644e19828f46.tar.xz
puppet-644ad7e41880fe8c9e73a099e9d6644e19828f46.zip
Fixing callers to Parser to only pass environment
We previously passed a hash of options but now just the environment. Signed-off-by: Luke Kanies <luke@reductivelabs.com>
-rw-r--r--lib/puppet/parser/parser_support.rb4
-rw-r--r--lib/puppet/util/rdoc/parser.rb2
-rwxr-xr-xspec/integration/parser/compiler.rb2
-rwxr-xr-xspec/integration/parser/parser.rb2
-rwxr-xr-xspec/unit/parser/compiler.rb3
5 files changed, 5 insertions, 8 deletions
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb
index ac26ca71a..b21ead3af 100644
--- a/lib/puppet/parser/parser_support.rb
+++ b/lib/puppet/parser/parser_support.rb
@@ -175,7 +175,7 @@ class Puppet::Parser::Parser
end
files.collect { |file|
- parser = Puppet::Parser::Parser.new(:environment => @environment)
+ parser = Puppet::Parser::Parser.new(@environment)
parser.files = self.files
Puppet.debug("importing '%s'" % file)
@@ -195,8 +195,6 @@ class Puppet::Parser::Parser
end
def initialize(env)
- puts caller and raise "fix your calling of Parser.new" if env.is_a?(Hash)
-
# The environment is needed to know how to find the resource type collection.
@environment = env.is_a?(String) ? Puppet::Node::Environment.new(env) : env
initvars()
diff --git a/lib/puppet/util/rdoc/parser.rb b/lib/puppet/util/rdoc/parser.rb
index 9a2bef932..0693c44a5 100644
--- a/lib/puppet/util/rdoc/parser.rb
+++ b/lib/puppet/util/rdoc/parser.rb
@@ -33,7 +33,7 @@ class Parser
def scan
Puppet.info "rdoc: scanning %s" % @input_file_name
if @input_file_name =~ /\.pp$/
- @parser = Puppet::Parser::Parser.new(:environment => Puppet[:environment])
+ @parser = Puppet::Parser::Parser.new(Puppet[:environment])
@parser.file = @input_file_name
@ast = @parser.parse
end
diff --git a/spec/integration/parser/compiler.rb b/spec/integration/parser/compiler.rb
index 27666400b..7ce24f558 100755
--- a/spec/integration/parser/compiler.rb
+++ b/spec/integration/parser/compiler.rb
@@ -21,7 +21,7 @@ describe Puppet::Parser::Compiler do
Puppet.settings[:config_version] = 'git rev-parse HEAD'
- @parser = Puppet::Parser::Parser.new :environment => "development"
+ @parser = Puppet::Parser::Parser.new "development"
@compiler = Puppet::Parser::Compiler.new(@node, @parser)
@compiler.catalog.version.should == version
diff --git a/spec/integration/parser/parser.rb b/spec/integration/parser/parser.rb
index cc6591ce4..08cab5621 100755
--- a/spec/integration/parser/parser.rb
+++ b/spec/integration/parser/parser.rb
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
describe Puppet::Parser::Parser do
before :each do
@resource_type_collection = Puppet::Parser::ResourceTypeCollection.new("env")
- @parser = Puppet::Parser::Parser.new :environment => "development", :resource_type_collection => @resource_type_collection
+ @parser = Puppet::Parser::Parser.new "development"
end
describe "when parsing comments before statement" do
diff --git a/spec/unit/parser/compiler.rb b/spec/unit/parser/compiler.rb
index d23d22565..a2b2e4d51 100755
--- a/spec/unit/parser/compiler.rb
+++ b/spec/unit/parser/compiler.rb
@@ -33,7 +33,7 @@ end
describe Puppet::Parser::Compiler do
before :each do
@node = Puppet::Node.new "testnode"
- @parser = Puppet::Parser::Parser.new :environment => "development"
+ @parser = Puppet::Parser::Parser.new "development"
@scope_resource = stub 'scope_resource', :builtin? => true, :finish => nil, :ref => 'Class[main]', :type => "class"
@scope = stub 'scope', :resource => @scope_resource, :source => mock("source")
@@ -75,7 +75,6 @@ describe Puppet::Parser::Compiler do
node = Puppet::Node.new("mynode")
node.classes = %w{foo bar}
compiler = Puppet::Parser::Compiler.new(node, @parser)
- p compiler.classlist
compiler.classlist.should include("foo")
compiler.classlist.should include("bar")