Closed andylytical closed 3 years ago
Selector expression will simplify this code and ease future maintenance efforts.
$day_of_week = $update_day_of_week ? { String[1] => $update_day_of_week, default => profile_update_os::calculate_day_of_week($facts['hostname']), }
A comment such as, # Use default values for empty parameters, could also be very helpful. https://github.com/ncsa/puppet-profile_update_os/blob/1ddf82231503dd7ad829264925a8b05ac1279201/manifests/yum_upgrade.pp#L120-L133
# Use default values for empty parameters
Selector expressions cannot seem to check if a string or array of strings is empty. So, instead I cleaned up the if/else logic to be a bit easier to read.
Selector expression will simplify this code and ease future maintenance efforts.
A comment such as,
# Use default values for empty parameters
, could also be very helpful. https://github.com/ncsa/puppet-profile_update_os/blob/1ddf82231503dd7ad829264925a8b05ac1279201/manifests/yum_upgrade.pp#L120-L133