[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.1rc1-141-gcdb2b90

Markus Roberts Markus at reality.com
Mon Aug 16 12:48:30 UTC 2010


The following commit has been merged in the upstream branch:
commit 760e418d254a8d2198d2c6eb466d783a5930ef47
Author: Markus Roberts <Markus at reality.com>
Date:   Sun Jul 25 22:14:31 2010 -0700

    Fix #4349 - Parsing with ignoreimport=true was always loading site.pp
    
    With the type collection refactoring, when accessing a fresh collection
    puppet tries to import the site.pp manifest (perfrom_initial_import).
    In the case of puppetdoc, we are parsing site.pp by ourselves, so we
    ended parsing it twice, resulting in an "import loop detected" error.
    
    Signed-off-by: Brice Figureau <brice-puppet at daysofwonder.com>

diff --git a/lib/puppet/resource/type_collection.rb b/lib/puppet/resource/type_collection.rb
index 6a93336..90b6df9 100644
--- a/lib/puppet/resource/type_collection.rb
+++ b/lib/puppet/resource/type_collection.rb
@@ -153,6 +153,7 @@ class Puppet::Resource::TypeCollection
   end
 
   def perform_initial_import
+    return if Puppet.settings[:ignoreimport]
     parser = Puppet::Parser::Parser.new(environment)
     if code = Puppet.settings.uninterpolated_value(:code, environment.to_s) and code != ""
       parser.string = code
diff --git a/spec/unit/resource/type_collection_spec.rb b/spec/unit/resource/type_collection_spec.rb
index 09643cd..45fc05d 100644
--- a/spec/unit/resource/type_collection_spec.rb
+++ b/spec/unit/resource/type_collection_spec.rb
@@ -400,6 +400,14 @@ describe Puppet::Resource::TypeCollection do
       @parser.expects(:parse).raises ArgumentError
       lambda { @code.perform_initial_import }.should raise_error(Puppet::Error)
     end
+
+    it "should not do anything if the ignore_import settings is set" do
+      Puppet.settings[:ignoreimport] = true
+      @parser.expects(:string=).never
+      @parser.expects(:file=).never
+      @parser.expects(:parse).never
+      @code.perform_initial_import
+    end
   end
 
   describe "when determining the configuration version" do

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list