summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBruce Williams <bruce@codefluency.com>2009-11-05 18:07:40 -0800
committerJames Turnbull <james@lovedthanlost.net>2009-11-17 20:46:10 +1100
commit7f2e5fc51b64d5a9281a7e65a88b378b1c99d03f (patch)
treea0855f59c9954f797c81a833767b2eb308f24244 /lib
parentf0eaf20f863f0f1fdcf01b620529f68609d4e0da (diff)
downloadpuppet-7f2e5fc51b64d5a9281a7e65a88b378b1c99d03f.tar.gz
puppet-7f2e5fc51b64d5a9281a7e65a88b378b1c99d03f.tar.xz
puppet-7f2e5fc51b64d5a9281a7e65a88b378b1c99d03f.zip
Fix #2671, preferred_serialization_format does not complain about invalid values
This modifies `supported_formats` to warn when the `preferred_serialization_format` setting is invalid (and ignored in favor of the default value). I built the tests for this behavior alongside the existing FormatHandler tests for *valid* `preferred_serialization_format` values (and did some restructuring to extract common setup code to `before` blocks). Signed-off-by: Bruce Williams <bruce@codefluency.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/network/format_handler.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/puppet/network/format_handler.rb b/lib/puppet/network/format_handler.rb
index 2ffbcef3d..e508a0283 100644
--- a/lib/puppet/network/format_handler.rb
+++ b/lib/puppet/network/format_handler.rb
@@ -129,6 +129,8 @@ module Puppet::Network::FormatHandler
if list.include?(preferred_format)
list.delete(preferred_format)
list.unshift(preferred_format)
+ else
+ Puppet.warning "Value of 'preferred_serialization_format' ('#{preferred_format}') is invalid, using default ('#{list.first}')"
end
list
end