diff options
| author | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-05-17 14:50:40 -0700 |
|---|---|---|
| committer | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-05-17 14:50:40 -0700 |
| commit | f9e44f041b3fdc120b1c78554c35c83f7517152e (patch) | |
| tree | f5d4687277fff6fe697a92089f1fa9283dce1bb4 /lib | |
| parent | 99d437d2bbc2339f092304715ec562fbbcb0a50c (diff) | |
| parent | c8b294a0b0a1fc91a64c0a1ac3bab3b2aec92faf (diff) | |
| download | puppet-f9e44f041b3fdc120b1c78554c35c83f7517152e.tar.gz puppet-f9e44f041b3fdc120b1c78554c35c83f7517152e.tar.xz puppet-f9e44f041b3fdc120b1c78554c35c83f7517152e.zip | |
Merge branch '2.7.x' into 2.7.next
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/face/certificate.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/face/resource.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/interface/action.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/interface/action_builder.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/interface/option_builder.rb | 4 | ||||
| -rw-r--r-- | lib/puppet/network/client.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/network/format.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/resource.rb | 2 | ||||
| -rw-r--r-- | lib/puppet/util.rb | 1 | ||||
| -rw-r--r-- | lib/puppet/util/selinux.rb | 2 |
10 files changed, 12 insertions, 11 deletions
diff --git a/lib/puppet/face/certificate.rb b/lib/puppet/face/certificate.rb index ee2b2873f..859946623 100644 --- a/lib/puppet/face/certificate.rb +++ b/lib/puppet/face/certificate.rb @@ -8,7 +8,7 @@ Puppet::Indirector::Face.define(:certificate, '0.0.1') do summary "Provide access to the CA for certificate management" description <<-EOT This face interacts with a local or remote Puppet certificate - authority. Currently, its behavior is not a full superset of puppet + authority. Currently, its behavior is not a full superset of puppet cert; specifically, it is unable to mimic puppet cert's "clean" option, and its "generate" action submits a CSR rather than creating a signed certificate. diff --git a/lib/puppet/face/resource.rb b/lib/puppet/face/resource.rb index ed6360888..87e587624 100644 --- a/lib/puppet/face/resource.rb +++ b/lib/puppet/face/resource.rb @@ -7,7 +7,7 @@ Puppet::Indirector::Face.define(:resource, '0.0.1') do summary "Interact directly with resources via the RAL, like ralsh" description <<-EOT This face provides a Ruby API with functionality similar to the puppet - resource (née ralsh) command line application. It is not intended to be + resource (originally ralsh) command line application. It is not intended to be used from the command line. EOT notes <<-EOT diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb index 622371a4e..3c377a49f 100644 --- a/lib/puppet/interface/action.rb +++ b/lib/puppet/interface/action.rb @@ -192,7 +192,7 @@ class Puppet::Interface::Action # but will on 1.9.2, which treats it as "no arguments". Which bites, # because this just begs for us to wind up in the horrible situation # where a 1.8 vs 1.9 error bites our end users. --daniel 2011-04-19 - raise ArgumentError, "action when_invoked requires at least one argument (options)" + raise ArgumentError, "when_invoked requires at least one argument (options) for action #{@name}" elsif arity > 0 then range = Range.new(1, arity - 1) decl = range.map { |x| "arg#{x}" } << "options = {}" diff --git a/lib/puppet/interface/action_builder.rb b/lib/puppet/interface/action_builder.rb index 62db8de06..4948f5fab 100644 --- a/lib/puppet/interface/action_builder.rb +++ b/lib/puppet/interface/action_builder.rb @@ -49,9 +49,9 @@ class Puppet::Interface::ActionBuilder # Metaprogram the simple DSL from the target class. Puppet::Interface::Action.instance_methods.grep(/=$/).each do |setter| next if setter =~ /^=/ - property = setter.sub(/=$/, '') + property = setter.to_s.chomp('=') - unless public_instance_methods.include? property + unless method_defined? property # Using eval because the argument handling semantics are less awful than # when we use the define_method/block version. The later warns on older # Ruby versions if you pass the wrong number of arguments, but carries diff --git a/lib/puppet/interface/option_builder.rb b/lib/puppet/interface/option_builder.rb index 8f358c222..5676ec977 100644 --- a/lib/puppet/interface/option_builder.rb +++ b/lib/puppet/interface/option_builder.rb @@ -18,9 +18,9 @@ class Puppet::Interface::OptionBuilder # Metaprogram the simple DSL from the option class. Puppet::Interface::Option.instance_methods.grep(/=$/).each do |setter| next if setter =~ /^=/ - dsl = setter.sub(/=$/, '') + dsl = setter.to_s.chomp('=') - unless private_instance_methods.include? dsl + unless private_method_defined? dsl define_method(dsl) do |value| @option.send(setter, value) end end end diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb index cd88b9d84..c56b21393 100644 --- a/lib/puppet/network/client.rb +++ b/lib/puppet/network/client.rb @@ -23,7 +23,7 @@ class Net::HTTP # JJM: This is a "backport" of sorts to older ruby versions which # do not have this accessor. See #896 for more information. - attr_accessor :enable_post_connection_check unless Net::HTTP.instance_methods.include? "enable_post_connection_check" + attr_accessor :enable_post_connection_check unless Net::HTTP.method_defined? "enable_post_connection_check" end # The base class for all of the clients. Many clients just directly diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb index 9cd6cf0b5..69895c344 100644 --- a/lib/puppet/network/format.rb +++ b/lib/puppet/network/format.rb @@ -106,6 +106,6 @@ class Puppet::Network::Format method = send(name) - return(type == :class ? klass.respond_to?(method) : klass.instance_methods.include?(method)) + return(type == :class ? klass.respond_to?(method) : klass.method_defined?(method)) end end diff --git a/lib/puppet/resource.rb b/lib/puppet/resource.rb index 214516908..59e387d00 100644 --- a/lib/puppet/resource.rb +++ b/lib/puppet/resource.rb @@ -269,7 +269,7 @@ class Puppet::Resource else " %-#{attr_max}s => %s,\n" % [ k, "\'#{v}\'" ] end - } + }.join "%s { '%s':\n%s}" % [self.type.to_s.downcase, self.title, attributes] end diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index d06f44808..ce9d4642b 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -1,5 +1,6 @@ # A module to collect utility functions. +require 'English' require 'puppet/util/monkey_patches' require 'sync' require 'puppet/external/lock' diff --git a/lib/puppet/util/selinux.rb b/lib/puppet/util/selinux.rb index cec8a57d9..255388d58 100644 --- a/lib/puppet/util/selinux.rb +++ b/lib/puppet/util/selinux.rb @@ -140,7 +140,7 @@ module Puppet::Util::SELinux def read_mounts mounts = "" begin - if File.instance_methods.include? "read_nonblock" + if File.method_defined? "read_nonblock" # If possible we use read_nonblock in a loop rather than read to work- # a linux kernel bug. See ticket #1963 for details. mountfh = File.open("/proc/mounts") |
