diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-07 10:03:07 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-07 10:03:07 -0800 |
commit | 7b0ec41b478c757522cb9c16aa061955bdf746bd (patch) | |
tree | 254df9e3ce3ad02956d2fc6d50f236c9cd1d6102 /lib/chef/resource/service.rb | |
parent | 767e9ad1e1332bb49dee5e9ed23db17bdf87d2e2 (diff) | |
download | chef-7b0ec41b478c757522cb9c16aa061955bdf746bd.tar.gz |
add back the Array form of setting supports
bonus fix: i believe the array form was mutating the default values, it
should stop doing that now.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource/service.rb')
-rw-r--r-- | lib/chef/resource/service.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index 77c99fbdc6..d9f0969ecb 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -30,7 +30,9 @@ class Chef allowed_actions :enable, :disable, :start, :stop, :restart, :reload, :mask, :unmask - property :supports, Hash, default: { restart: nil, reload: nil, status: nil } + # this is a poor API please do not re-use this pattern + property :supports, Hash, default: { restart: nil, reload: nil, status: nil }, + coerce: proc { |x| x.is_a?(Array) ? x.each_with_object({}) { |i, m| m[i] = true } : x } def initialize(name, run_context = nil) super |