Remove empty string defaults from class parameters
In preparation for puppet 4, the puppet-lint-empty_string-check gem helps find where empty strings are assigned to variables because how empty strings are evaluated changes in puppet 4, so the easiest thing is to just remove usage of them. More importantly, it is not appropriate to set defaults for parameters that are, realistically, required. If the users leaves these parameters blank, puppet will apply most resources successfully but fail mysteriously on the Exec['run_accessbot'] resource, causing the user to spend additional time debugging. If no defaults are provided in the puppet class, puppet fill fail with a message stating that the user must supply values. This "fail fast" approach is much preferred to debugging obtuse python tracebacks. This change is technically backwards-incompatible. However, it will not break Infra because we are already supplying these parameters via system-config/modules/openstack_project/manifests/eavesdrop.pp. If there are other users using this module and they are not passing in these parameters, then their accessbots cannot possibly be running. An alternative approach is to supply undef as parameter defaults. This will allow the puppet-lint gem to pass, but does not help the user at all. Change-Id: I046340b852e7e8983b741e5bad415678977bea0d
This commit is contained in:
parent
4d84c48211
commit
6771d4f8ce
|
@ -1,10 +1,10 @@
|
|||
# == Class: accessbot
|
||||
#
|
||||
class accessbot(
|
||||
$nick = '',
|
||||
$password = '',
|
||||
$server = '',
|
||||
$channel_file = '',
|
||||
$nick,
|
||||
$password,
|
||||
$server,
|
||||
$channel_file,
|
||||
) {
|
||||
|
||||
user { 'accessbot':
|
||||
|
|
Loading…
Reference in New Issue