summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormarkgibbons <mark.gibbons@nordstrom.com>2016-12-12 10:04:15 -0800
committermarkgibbons <mark.gibbons@nordstrom.com>2016-12-12 10:11:24 -0800
commit5e75740ed6347d06494a1001e1111f87a7b0fe75 (patch)
treeded1838e6873900edd249b97f1e979b9f66b70e8 /lib
parentf3ffecebf4ebe7deaae37a56269a77f081b03218 (diff)
downloadchef-5e75740ed6347d06494a1001e1111f87a7b0fe75.tar.gz
smf_recursive: Rename the property "recursive" to "options".
Allow options to be an array or a string. Allow the additional svcadm options for the enable and disable actions. Signed-off-by: markgibbons <mark.gibbons@nordstrom.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/service/solaris.rb7
-rw-r--r--lib/chef/resource/service.rb4
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/chef/provider/service/solaris.rb b/lib/chef/provider/service/solaris.rb
index c3e47b3a5c..64557ebf1c 100644
--- a/lib/chef/provider/service/solaris.rb
+++ b/lib/chef/provider/service/solaris.rb
@@ -56,12 +56,13 @@ class Chef
def enable_service
shell_out!(default_init_command, "clear", @new_resource.service_name) if @maintenance
- start_flags = @new_resource.recursive ? "-sr" : "-s"
- shell_out!(default_init_command, "enable", start_flags , @new_resource.service_name)
+ enable_flags = [ "-s", @new_resource.options ].compact.join(' ')
+ shell_out!(default_init_command, "enable", enable_flags , @new_resource.service_name)
end
def disable_service
- shell_out!(default_init_command, "disable", "-s", @new_resource.service_name)
+ disable_flags = [ "-s", @new_resource.options ].compact.join(' ')
+ shell_out!(default_init_command, "disable", disable_flags, @new_resource.service_name)
end
alias_method :stop_service, :disable_service
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb
index c230278434..4e87966552 100644
--- a/lib/chef/resource/service.rb
+++ b/lib/chef/resource/service.rb
@@ -213,11 +213,11 @@ class Chef
end
end
- def recursive(arg = nil)
+ def options(arg = nil)
set_or_return(
:user,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ :kind_of => [ Array, String ]
)
end