This patch set significantly simplifies the management and definition of parameters in Puppet::Type subclasses.
The main goal of this work is to make it easier to split Puppet::Type into three classes (a class/module for managing which types exist, a class for modeling resource types, and a class for modeling resources). We previously had completely separate methods for parameters, properties, and metaparameters, and this generally unifies them, and definitely simplifies and cleans up the interfaces. The vast majority of this work falls into two categories: * Restructuring Puppet::Type * Changing the rest of the system to reflect those changes, primarily just renaming methods or something very close to that There are three potential issues with this commit series: * We remove the old methods, so there's no backward compatibility for the few people who used them * We change the behavior of Puppet::Type.parameters, which used to return a list of parameter names and now returns actual parameter classes * We no longer support having properties and metaparameters with the same name. This means we had to disable 'alias' in the Nagios types. In general, I think the affect of this is minimal to none, but we can look at modifying the commit series if it's deemed to big of a step. lib/puppet/application/describe.rb | 12 +- lib/puppet/metatype/manager.rb | 134 ----- lib/puppet/parameter.rb | 24 +- lib/puppet/parser/compiler.rb | 6 +- lib/puppet/parser/resource.rb | 6 +- lib/puppet/property.rb | 2 +- lib/puppet/provider.rb | 4 +- lib/puppet/provider/aixobject.rb | 2 +- lib/puppet/provider/ldap.rb | 8 +- .../provider/macauthorization/macauthorization.rb | 2 +- lib/puppet/provider/nameservice.rb | 4 +- .../provider/nameservice/directoryservice.rb | 12 +- lib/puppet/provider/network_device.rb | 2 +- lib/puppet/provider/parsedfile.rb | 5 +- lib/puppet/provider/user/pw.rb | 2 +- lib/puppet/provider/user/user_role_add.rb | 2 +- lib/puppet/provider/user/useradd.rb | 2 +- lib/puppet/provider/zfs/solaris.rb | 2 +- lib/puppet/provider/zone/solaris.rb | 2 +- lib/puppet/reference/metaparameter.rb | 10 +- lib/puppet/reference/type.rb | 13 +- lib/puppet/resource/type.rb | 4 +- lib/puppet/transportable.rb | 2 +- lib/puppet/type.rb | 590 +++++++++----------- lib/puppet/type/cron.rb | 1 - lib/puppet/type/port.rb | 2 +- lib/puppet/type/resources.rb | 6 +- lib/puppet/type/schedule.rb | 2 +- lib/puppet/type/yumrepo.rb | 2 +- lib/puppet/type/zone.rb | 2 +- lib/puppet/util/nagios_maker.rb | 8 + spec/integration/type_spec.rb | 32 -- spec/unit/parameter_spec.rb | 21 + spec/unit/property_spec.rb | 25 - spec/unit/provider/group/ldap_spec.rb | 14 +- spec/unit/provider/ldap_spec.rb | 16 +- spec/unit/provider/network_device_spec.rb | 6 +- spec/unit/transaction_spec.rb | 2 +- spec/unit/type/augeas_spec.rb | 12 +- spec/unit/type/component_spec.rb | 4 +- spec/unit/type/computer_spec.rb | 12 +- spec/unit/type/cron_spec.rb | 6 +- spec/unit/type/file/checksum_spec.rb | 2 +- spec/unit/type/file/content_spec.rb | 4 +- spec/unit/type/file/ctime.rb | 2 +- spec/unit/type/file/ensure_spec.rb | 2 +- spec/unit/type/file/group_spec.rb | 2 +- spec/unit/type/file/mtime.rb | 2 +- spec/unit/type/file/owner_spec.rb | 2 +- spec/unit/type/file/selinux_spec.rb | 2 +- spec/unit/type/file/source_spec.rb | 4 +- spec/unit/type/file/type.rb | 2 +- spec/unit/type/file_spec.rb | 20 +- spec/unit/type/filebucket_spec.rb | 2 +- spec/unit/type/group_spec.rb | 4 +- spec/unit/type/host_spec.rb | 18 +- spec/unit/type/interface_spec.rb | 4 +- spec/unit/type/macauthorization_spec.rb | 20 +- spec/unit/type/mcx_spec.rb | 8 +- spec/unit/type/mount_spec.rb | 6 +- spec/unit/type/nagios_spec.rb | 14 +- spec/unit/type/noop_metaparam_spec.rb | 2 +- spec/unit/type/package_spec.rb | 4 +- spec/unit/type/selboolean_spec.rb | 4 +- spec/unit/type/selmodule_spec.rb | 4 +- spec/unit/type/service_spec.rb | 8 +- spec/unit/type/ssh_authorized_key_spec.rb | 8 +- spec/unit/type/sshkey_spec.rb | 4 +- spec/unit/type/tidy_spec.rb | 4 +- spec/unit/type/user_spec.rb | 42 +- spec/unit/type/vlan_spec.rb | 4 +- spec/unit/type/zfs_spec.rb | 4 +- spec/unit/type/zone_spec.rb | 4 +- spec/unit/type/zpool_spec.rb | 4 +- spec/unit/type_spec.rb | 241 +++++++- spec/unit/util/nagios_maker_spec.rb | 38 +- test/language/snippets.rb | 6 +- test/lib/puppettest/fakes.rb | 16 +- test/ral/manager/attributes.rb | 100 +--- test/ral/manager/manager.rb | 54 -- test/ral/manager/provider.rb | 11 - test/ral/manager/type.rb | 10 +- test/ral/providers/group.rb | 2 +- test/ral/providers/parsedfile.rb | 2 +- test/ral/providers/provider.rb | 4 +- test/ral/providers/user.rb | 6 +- test/ral/providers/user/useradd.rb | 4 +- test/ral/type/exec.rb | 3 +- test/ral/type/file/target.rb | 2 +- test/ral/type/resources.rb | 10 +- 90 files changed, 794 insertions(+), 956 deletions(-) -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
