diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-06 19:06:23 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-06 19:06:23 -0800 |
commit | 3e9b626b750fa7fd91c5cdad169992a606120d7b (patch) | |
tree | 5eb550341009b8c5ec43c2680f5d52773a8c8db5 /lib/chef/resource/service.rb | |
parent | 29c39b56764a52945609b0eeb0f6068da6ed0041 (diff) | |
download | chef-3e9b626b750fa7fd91c5cdad169992a606120d7b.tar.gz |
remove most of supports API
still there on service (where it makes some sense)
also still on mount (because i have no idea if that is actively being
used or if it makes any sense at all).
converts it to a property on mount + service as well.
also removed setting it as an array -- did we ever document that and/or
does anyone use it? i'm not religiously against that way of setting
it, but if nobody ever used it i'd rather remove the YAGNI.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource/service.rb')
-rw-r--r-- | lib/chef/resource/service.rb | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb index 1ca4b84af0..77c99fbdc6 100644 --- a/lib/chef/resource/service.rb +++ b/lib/chef/resource/service.rb @@ -1,7 +1,7 @@ # # Author:: AJ Christensen (<aj@hjksolutions.com>) # Author:: Tyler Cloke (<tyler@chef.io>) -# Copyright:: Copyright 2008-2016, Chef Software, Inc. +# Copyright:: Copyright 2008-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,6 +30,8 @@ class Chef allowed_actions :enable, :disable, :start, :stop, :restart, :reload, :mask, :unmask + property :supports, Hash, default: { restart: nil, reload: nil, status: nil } + def initialize(name, run_context = nil) super @service_name = name @@ -48,7 +50,6 @@ class Chef @timeout = nil @run_levels = nil @user = nil - @supports = { :restart => nil, :reload => nil, :status => nil } end def service_name(arg = nil) @@ -201,17 +202,6 @@ class Chef :kind_of => [ String ] ) end - - def supports(args = {}) - if args.is_a? Array - args.each { |arg| @supports[arg] = true } - elsif args.any? - @supports = args - else - @supports - end - end - end end end |