diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2009-11-25 01:38:04 -0800 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-12-02 13:14:20 +1100 |
| commit | 07b94b4687686acd4f1bc2567f7902e676c2338f (patch) | |
| tree | 6f8d9aa40f1cbf19864744605ff974fd1b3f761b /lib/puppet/network | |
| parent | 3abcc896c84e1cd1c68fcb661c69090872294868 (diff) | |
| download | puppet-07b94b4687686acd4f1bc2567f7902e676c2338f.tar.gz puppet-07b94b4687686acd4f1bc2567f7902e676c2338f.tar.xz puppet-07b94b4687686acd4f1bc2567f7902e676c2338f.zip | |
2842 Format debugging should be removed
Replace this message that looks like an error
debug: Format s not supported for Puppet::FileServing::Metadata; has not implemented method 'from_s'
with
debug: file_metadata supports formats: b64_zlib_yaml marshal pson raw yaml; using pson
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'lib/puppet/network')
| -rw-r--r-- | lib/puppet/network/format.rb | 14 | ||||
| -rw-r--r-- | lib/puppet/network/format_handler.rb | 8 |
2 files changed, 8 insertions, 14 deletions
diff --git a/lib/puppet/network/format.rb b/lib/puppet/network/format.rb index a5be3aff8..d78124221 100644 --- a/lib/puppet/network/format.rb +++ b/lib/puppet/network/format.rb @@ -107,17 +107,7 @@ class Puppet::Network::Format method = send(name) - if type == :class - has_method = klass.respond_to?(method) - message = "has not implemented method '%s'" % method - else - has_method = klass.instance_methods.include?(method) - message = "has not implemented instance method '%s'" % method - end - - return true if has_method - - Puppet.debug "Format %s not supported for %s; %s" % [self.name, klass, message] - return false + return klass.respond_to?(method) if type == :class + return klass.instance_methods.include?(method) end end diff --git a/lib/puppet/network/format_handler.rb b/lib/puppet/network/format_handler.rb index e508a0283..544ba8291 100644 --- a/lib/puppet/network/format_handler.rb +++ b/lib/puppet/network/format_handler.rb @@ -119,7 +119,11 @@ module Puppet::Network::FormatHandler format_handler.format(b).weight <=> format_handler.format(a).weight end - put_preferred_format_first(result) + result = put_preferred_format_first(result) + + Puppet.debug "#{indirection.name} supports formats: #{result.sort.join(' ')}; using #{result.first}" + + result end private @@ -130,7 +134,7 @@ module Puppet::Network::FormatHandler list.delete(preferred_format) list.unshift(preferred_format) else - Puppet.warning "Value of 'preferred_serialization_format' ('#{preferred_format}') is invalid, using default ('#{list.first}')" + Puppet.warning "Value of 'preferred_serialization_format' (#{preferred_format}) is invalid for #{indirection.name}, using default (#{list.first})" end list end |
