From 6771d4f8ce9b791e8a5f4a5d5de849a887fc9620 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Thu, 2 Jul 2015 15:44:17 -0700 Subject: [PATCH] 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 --- manifests/init.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 800b8f4..a11e325 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,10 +1,10 @@ # == Class: accessbot # class accessbot( - $nick = '', - $password = '', - $server = '', - $channel_file = '', + $nick, + $password, + $server, + $channel_file, ) { user { 'accessbot':