Fixed issue number #30117 - When no parameters are given to a service, the service object is of type None and thus isn't iterable. This is contrary to the documentation which states that there are default values. Default values added as False

This commit is contained in:
Mads R. Christensen 2016-01-01 23:02:12 +01:00 committed by rallytime
parent 54b9641330
commit 51b57f1820

View file

@ -72,6 +72,16 @@ def beacon(config):
ret_dict = {}
ret_dict[service] = {'running': __salt__['service.status'](service)}
# If no options is given to the service, we fall back to the defaults
# assign a False value to oncleanshutdown and onchangeonly. Those
# key:values are then added to the service dictionary.
if config[service] is None:
defaults = {
'oncleanshutdown':False,
'onchangeonly':False
}
config[service] = defaults
# We only want to report the nature of the shutdown
# if the current running status is False
# as well as if the config for the beacon asks for it