diff options
author | Luke Kanies <luke@madstop.com> | 2007-11-23 16:49:14 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2007-11-23 16:49:14 -0600 |
commit | a670615fb6feef7ea41f3a31bee6a9a8c5dadc03 (patch) | |
tree | 66d976342d58f758e3c6bf565b5efab1427b09cf | |
parent | a525ab5f1d643dcd890a9f5fb34bbc5dab575393 (diff) | |
parent | b745f04d936575d3a1a54b98bccc4b49de734531 (diff) | |
download | puppet-a670615fb6feef7ea41f3a31bee6a9a8c5dadc03.tar.gz puppet-a670615fb6feef7ea41f3a31bee6a9a8c5dadc03.tar.xz puppet-a670615fb6feef7ea41f3a31bee6a9a8c5dadc03.zip |
Merge branch 'master' of ssh://reductivelabs.com/opt/rl/git/puppet
-rw-r--r-- | CHANGELOG | 3 | ||||
-rwxr-xr-x | bin/puppetdoc | 54 | ||||
-rw-r--r-- | lib/puppet/parameter.rb | 2 | ||||
-rw-r--r-- | lib/puppet/util/docs.rb | 5 | ||||
-rwxr-xr-x | lib/puppet/util/posix.rb | 7 |
5 files changed, 44 insertions, 27 deletions
@@ -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 |