Merge pull request #616 from roman-mueller/newtype_deprecation
(MODULES-2007) Fix Puppet.newtype deprecation warning
This commit is contained in:
commit
df2886ecbe
1 changed files with 23 additions and 25 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue