From 460623e3a13a5abf64b8dbbeac46fcafbb0a6a59 Mon Sep 17 00:00:00 2001 From: Roman Mueller Date: Tue, 5 May 2015 00:04:43 +0200 Subject: [PATCH] (MODULES-2007) Fix Puppet.newtype deprecation warning --- lib/puppet/type/postgresql_conf.rb | 48 ++++++++++++++---------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/lib/puppet/type/postgresql_conf.rb b/lib/puppet/type/postgresql_conf.rb index f227fd7..6dbaaee 100644 --- a/lib/puppet/type/postgresql_conf.rb +++ b/lib/puppet/type/postgresql_conf.rb @@ -1,31 +1,29 @@ -module Puppet - newtype(:postgresql_conf) do +Puppet::Type.newtype(:postgresql_conf) do - @doc = "This type allows puppet to manage postgresql.conf parameters." + @doc = "This type allows puppet to manage postgresql.conf parameters." - ensurable + ensurable - newparam(:name) do - desc "The postgresql parameter name to manage." - isnamevar - - newvalues(/^[\w\.]+$/) - end - - newproperty(:value) do - desc "The value to set for this parameter." - end - - newproperty(:target) do - desc "The path to postgresql.conf" - defaultto { - if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile) - @resource.class.defaultprovider.default_target - else - nil - end - } - end + newparam(:name) do + desc "The postgresql parameter name to manage." + isnamevar + newvalues(/^[\w\.]+$/) end + + newproperty(:value) do + desc "The value to set for this parameter." + end + + newproperty(:target) do + desc "The path to postgresql.conf" + defaultto { + if @resource.class.defaultprovider.ancestors.include?(Puppet::Provider::ParsedFile) + @resource.class.defaultprovider.default_target + else + nil + end + } + end + end