The fix for #4349 caused --parse-only not to detect syntax errors when
--ignore-import was used by adding a return statement that bypassed the
initial import:

commit 760e418d254a8d2198d2c6eb466d783a5930ef47
def perform_initial_import
+   return if Puppet.settings[:ignoreimport]

The problem that #4349 fixed was more generally fixed in commit
99c1019e1d3402ec8e476dc859d5aaef82ec4f69 for ticket #4798 so the return
statement is no longer needed, so reverting the commit for #4349 does
not reintroduce the problem of an import loop error when running puppet
doc.

Paired-with: Jesse Wolfe

Signed-off-by: Matt Robinson <[email protected]>
---
 lib/puppet/resource/type_collection.rb     |    1 -
 spec/unit/resource/type_collection_spec.rb |    8 --------
 2 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/lib/puppet/resource/type_collection.rb 
b/lib/puppet/resource/type_collection.rb
index 63d1103..6a03458 100644
--- a/lib/puppet/resource/type_collection.rb
+++ b/lib/puppet/resource/type_collection.rb
@@ -153,7 +153,6 @@ 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 577aea4..ff4c222 100644
--- a/spec/unit/resource/type_collection_spec.rb
+++ b/spec/unit/resource/type_collection_spec.rb
@@ -426,14 +426,6 @@ 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
-- 
1.7.3.1

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to