[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:31:39 UTC 2010


The following commit has been merged in the upstream branch:
commit 644ad7e41880fe8c9e73a099e9d6644e19828f46
Author: Luke Kanies <luke at reductivelabs.com>
Date:   Wed Jan 6 16:44:48 2010 -0800

    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 at reductivelabs.com>

diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb
index ac26ca7..b21ead3 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 9a2bef9..0693c44 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 2766640..7ce24f5 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 cc6591c..08cab56 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 d23d225..a2b2e4d 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")

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list