ghoneycutt / puppet-module-pam

Puppet module to manage PAM
Other
18 stars 79 forks source link

please use the stdlib validate_legacy function #165

Closed Falkor closed 5 years ago

Falkor commented 7 years ago

Hi,

As you probably know, all validate_* function from the puppetlabs/stdlib are deprecated and should be replaced by a call to validate_legacy. A pass to change all of them is thus required.

For instance, at present and using puppet 4.10.6 (i.e. >= 4.4.0), usage of the pam module raises many warning about this deprecation such as:

Warning: This method is deprecated, please use match expressions with Stdlib::Compat::String instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions. at ["/etc/puppetlabs/code/environments/production/modules/pam/manifests/init.pp", 60]:
   (at /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Absolute_Path. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/production/modules/nsswitch/manifests/init.pp", 36]:["/etc/puppetlabs/code/environments/production/modules/pam/manifests/init.pp", 67]
   (at /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
Warning: This method is deprecated, please use the stdlib validate_legacy function, with Pattern[]. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/production/modules/nsswitch/manifests/init.pp", 37]:["/etc/puppetlabs/code/environments/production/modules/pam/manifests/init.pp", 67]
   (at /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/production/modules/nsswitch/manifests/init.pp", 41]:["/etc/puppetlabs/code/environments/production/modules/pam/manifests/init.pp", 67]
   (at /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/production/modules/pam/manifests/init.pp", 1151]:
   (at /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
Warning: This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README. at ["/etc/puppetlabs/code/environments/production/modules/pam/manifests/init.pp", 1241]:
   (at /etc/puppetlabs/code/environments/production/modules/stdlib/lib/puppet/functions/deprecation.rb:25:in `deprecation')
hdep commented 5 years ago

Maybe we should use datatypse instead. I think this is a good way to do this now.

ghoneycutt commented 5 years ago

This is solved in v3 which uses data types. Thank you for your participation!