[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.1rc3-129-g74f8285
James Turnbull
james at lovedthanlost.net
Tue Sep 7 13:31:02 UTC 2010
The following commit has been merged in the upstream branch:
commit 4d55c6e72f2576fe7ab27f874db030de5ab6fcee
Author: Markus Roberts <Markus at reality.com>
Date: Sat Sep 4 18:45:09 2010 -0700
Fix for tests broken by fix for #4489 -- stub standalone
If the file streaming is to be thwarted when running standalone the test for
standalone needs to be stubbed when running specs, lest the tests inexplicably
fail.
diff --git a/lib/puppet/type/file/content.rb b/lib/puppet/type/file/content.rb
index f5b65d3..b8f30a9 100755
--- a/lib/puppet/type/file/content.rb
+++ b/lib/puppet/type/file/content.rb
@@ -161,12 +161,16 @@ module Puppet
}
end
+ def self.standalone?
+ Puppet.settings[:name] == "apply"
+ end
+
def each_chunk_from(source_or_content)
if source_or_content.is_a?(String)
yield source_or_content
elsif source_or_content.nil?
yield read_file_from_filebucket
- elsif Puppet.settings[:name] == "apply"
+ elsif self.class.standalone?
yield source_or_content.content
elsif source_or_content.local?
chunk_file_from_disk(source_or_content) { |chunk| yield chunk }
diff --git a/spec/unit/type/file/content_spec.rb b/spec/unit/type/file/content_spec.rb
index a01a14a..cde643f 100755
--- a/spec/unit/type/file/content_spec.rb
+++ b/spec/unit/type/file/content_spec.rb
@@ -6,6 +6,7 @@ content = Puppet::Type.type(:file).attrclass(:content)
describe content do
before do
@resource = Puppet::Type.type(:file).new :path => "/foo/bar"
+ content.stubs(:standalone?).returns(false)
end
it "should be a subclass of Property" do
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list