Skip to content

Commit

Permalink
(#21427) Issue deprecation warning for b64_zlib_yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
zaphod42 committed Jun 25, 2013
1 parent add942b commit 8235471
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/puppet/network/formats.rb
Expand Up @@ -38,6 +38,10 @@ def supported?(klass)
Puppet::Network::FormatHandler.create_serialized_formats(:b64_zlib_yaml) do
require 'base64'

def issue_deprecation_warning
Puppet.deprecation_warning("The b64_zlib_yaml format is deprecated and will be removed in a future release. See http://links.puppetlabs.com/deprecate_yaml_on_network")
end

def use_zlib?
Puppet.features.zlib? && Puppet[:zlib]
end
Expand All @@ -51,22 +55,30 @@ def requiring_zlib
end

def intern(klass, text)
issue_deprecation_warning

requiring_zlib do
Puppet::Network::FormatHandler.format(:yaml).intern(klass, decode(text))
end
end

def intern_multiple(klass, text)
issue_deprecation_warning

requiring_zlib do
Puppet::Network::FormatHandler.format(:yaml).intern_multiple(klass, decode(text))
end
end

def render(instance)
issue_deprecation_warning

encode(instance.to_yaml)
end

def render_multiple(instances)
issue_deprecation_warning

encode(instances.to_yaml)
end

Expand Down

0 comments on commit 8235471

Please sign in to comment.