summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG3
-rwxr-xr-xbin/puppetdoc54
-rw-r--r--lib/puppet/parameter.rb2
-rw-r--r--lib/puppet/util/docs.rb5
-rwxr-xr-xlib/puppet/util/posix.rb7
5 files changed, 44 insertions, 27 deletions
diff --git a/CHANGELOG b/CHANGELOG
index e2b656333..35e2e44dc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+ Added calls to endpwent/endgrent when searching for user and group IDs,
+ which fixes #791.
+
Obviated 'target' in interfaces, as all file paths were automatically
calculated anyway. The parameter is still there, but it's
not used and just generates a warning.
diff --git a/bin/puppetdoc b/bin/puppetdoc
index 11f9818a9..be86cc618 100755
--- a/bin/puppetdoc
+++ b/bin/puppetdoc
@@ -68,33 +68,33 @@ Reference = Puppet::Util::Reference
begin
result.each { |opt,arg|
case opt
- when "--all"
- options[:all] = true
- when "--format"
- method = "to_%s" % arg
- if Reference.method_defined?(method)
- options[:format] = method
- else
- raise "Invalid output format %s" % arg
- end
- when "--mode"
- if Reference.modes.include?(arg)
- options[:mode] = arg.intern
- else
- raise "Invalid output mode %s" % arg
- end
- when "--list"
- puts Reference.references.collect { |r| Reference.reference(r).doc }.join("\n")
- exit(0)
- when "--reference"
- options[:references] << arg.intern
- when "--help"
- if Puppet.features.usage?
- RDoc::usage && exit
- else
- puts "No help available unless you have RDoc::usage installed"
- exit
- end
+ when "--all"
+ options[:all] = true
+ when "--format"
+ method = "to_%s" % arg
+ if Reference.method_defined?(method)
+ options[:format] = method
+ else
+ raise "Invalid output format %s" % arg
+ end
+ when "--mode"
+ if Reference.modes.include?(arg)
+ options[:mode] = arg.intern
+ else
+ raise "Invalid output mode %s" % arg
+ end
+ when "--list"
+ puts Reference.references.collect { |r| Reference.reference(r).doc }.join("\n")
+ exit(0)
+ when "--reference"
+ options[:references] << arg.intern
+ when "--help"
+ if Puppet.features.usage?
+ RDoc::usage && exit
+ else
+ puts "No help available unless you have RDoc::usage installed"
+ exit
+ end
end
}
rescue GetoptLong::InvalidOption => detail
diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb
index d15c1f622..fae0587e1 100644
--- a/lib/puppet/parameter.rb
+++ b/lib/puppet/parameter.rb
@@ -1,6 +1,7 @@
require 'puppet/util/methodhelper'
require 'puppet/util/log_paths'
require 'puppet/util/logging'
+require 'puppet/util/docs'
class Puppet::Parameter
include Puppet::Util
@@ -10,6 +11,7 @@ class Puppet::Parameter
include Puppet::Util::MethodHelper
class << self
include Puppet::Util
+ include Puppet::Util::Docs
attr_reader :validater, :munger, :name, :default, :required_features
attr_accessor :metaparam
diff --git a/lib/puppet/util/docs.rb b/lib/puppet/util/docs.rb
index aabf58d89..01178e5f4 100644
--- a/lib/puppet/util/docs.rb
+++ b/lib/puppet/util/docs.rb
@@ -67,6 +67,11 @@ module Puppet::Util::Docs
str + "\n"
end
+ attr_reader :nodoc
+ def nodoc?
+ nodoc
+ end
+
# Pad a field with spaces
def pad(value, length)
value.to_s + (" " * (length - value.to_s.length))
diff --git a/lib/puppet/util/posix.rb b/lib/puppet/util/posix.rb
index 84fb744a9..c518a8797 100755
--- a/lib/puppet/util/posix.rb
+++ b/lib/puppet/util/posix.rb
@@ -53,6 +53,13 @@ module Puppet::Util::POSIX
return object.send(field)
end
end
+
+ # Apparently the group/passwd methods need to get reset; if we skip
+ # this call, then new users aren't found.
+ case type
+ when :passwd: Etc.send(:endpwent)
+ when :group: Etc.send(:endgrent)
+ end
return nil
end