Merge pull request #616 from roman-mueller/newtype_deprecation

(MODULES-2007) Fix Puppet.newtype deprecation warning
This commit is contained in:
Hunter Haugen 2015-05-04 15:16:30 -07:00
commit df2886ecbe

View file

@ -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