[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.5rc1-120-g2247c80
Paul Berry
paul at puppetlabs.com
Mon Feb 7 06:42:16 UTC 2011
The following commit has been merged in the upstream branch:
commit 2d4fb3a609f30d3f974b169ff9428672dd96ddd0
Merge: 90f84fd613c6128ecc786fd40269f043474df1c5 70630b903b747db0148cd972b64e5162b8f459cc
Author: Paul Berry <paul at puppetlabs.com>
Date: Tue Feb 1 16:13:49 2011 -0800
Merge branch 'ticket/2.6.next/3165' into 2.6.next
* ticket/2.6.next/3165:
Fix #3165 Ralsh (bin/puppet resource) can't manage files
diff --combined lib/puppet/type/file.rb
index c66a53c,dc0fe7b..cbb51bb
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@@ -34,7 -34,7 +34,7 @@@ Puppet::Type.newtype(:file) d
validate do |value|
# accept various path syntaxes: lone slash, posix, win32, unc
- unless (Puppet.features.posix? and (value =~ /^\/$/ or value =~ /^\/[^\/]/)) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/))
+ unless (Puppet.features.posix? and value =~ /^\//) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/))
fail Puppet::Error, "File paths must be fully qualified, not '#{value}'"
end
end
@@@ -271,24 -271,17 +271,24 @@@
end
CREATORS = [:content, :source, :target]
+ SOURCE_ONLY_CHECKSUMS = [:none, :ctime, :mtime]
validate do
- count = 0
+ creator_count = 0
CREATORS.each do |param|
- count += 1 if self.should(param)
+ creator_count += 1 if self.should(param)
end
- count += 1 if @parameters.include?(:source)
- self.fail "You cannot specify more than one of #{CREATORS.collect { |p| p.to_s}.join(", ")}" if count > 1
+ creator_count += 1 if @parameters.include?(:source)
+ self.fail "You cannot specify more than one of #{CREATORS.collect { |p| p.to_s}.join(", ")}" if creator_count > 1
self.fail "You cannot specify a remote recursion without a source" if !self[:source] and self[:recurse] == :remote
+ self.fail "You cannot specify source when using checksum 'none'" if self[:checksum] == :none && !self[:source].nil?
+
+ SOURCE_ONLY_CHECKSUMS.each do |checksum_type|
+ self.fail "You cannot specify content when using checksum '#{checksum_type}'" if self[:checksum] == checksum_type && !self[:content].nil?
+ end
+
self.warning "Possible error: recurselimit is set but not recurse, no recursion will happen" if !self[:recurse] and self[:recurselimit]
end
@@@ -297,25 -290,8 +297,8 @@@
super(path.gsub(/\/+/, '/').sub(/\/$/, ''))
end
- # List files, but only one level deep.
- def self.instances(base = "/")
- return [] unless FileTest.directory?(base)
-
- files = []
- Dir.entries(base).reject { |e|
- e == "." or e == ".."
- }.each do |name|
- path = File.join(base, name)
- if obj = self[path]
- obj[:audit] = :all
- files << obj
- else
- files << self.new(
- :name => path, :audit => :all
- )
- end
- end
- files
+ def self.instances(base = '/')
+ return self.new(:name => base, :recurse => true, :recurselimit => 1, :audit => :all).recurse_local.values
end
@depthfirst = false
@@@ -786,7 -762,7 +769,7 @@@
# Make sure we get a new stat objct
expire
currentvalue = thing.retrieve
- thing.sync unless thing.insync?(currentvalue)
+ thing.sync unless thing.safe_insync?(currentvalue)
end
end
end
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list