puppet-snmp
puppet-snmp copied to clipboard
WIP: Simpify traditional access control parameters
Instead of allowing undef, plain strings or arrays of strings, just
allow arrays of strings. Parameters that previously defaulted to undef
now default to empty arrays.
This allows us to simplify the templates and we no longer have
Optional parameters that have default values set. (ro_community
defaulting to 'public' but allowing undef didn't make much sense
previously.)
View-based Access Control Model (VACM) is still recommended, but traditional access control is no longer deprecated.
Pull Request (PR) description
This Pull Request (PR) fixes the following issues
I do not think we should encourage the use of empty data sets like
'',[]and{}and should instead useundef.
Empty string I agree with, but [] and {} I think are often preferable to undef and this pattern is extremely popular. In this case in particular, where we are defaulting to a value, allowing undef doesn't make sense. I also don't like multiple ways of expressing no traditional access control communities. The acceptance tests already use empty arrays and not undef. https://github.com/voxpupuli/puppet-snmp/blob/a27f22dbf771cde6de511f773e9996e5de5f4a0b/spec/acceptance/snmp_spec.rb#L36
The acceptance tests already use empty arrays and not
undef.
Oups my fault.
I do not think we should encourage the use of empty data sets like
'',[]and{}and should instead useundef.
From our review guidelines:
Are there new params with datatype Hash or Array? If possible, they should default to empty Hash/Array instead of undef. You can also enforce the datastructure like Array[String]
Dear @alexjfisher, thanks for the PR!
This is Vox Pupuli Tasks, your friendly Vox Pupuli GitHub Bot. I noticed that your pull request contains merge conflict. Can you please rebase?
You can find my sourcecode at voxpupuli/vox-pupuli-tasks