summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-02-03 19:46:09 -0800
committerTim Smith <tsmith84@gmail.com>2020-02-05 11:10:08 -0800
commitdfcf60a2f4cf89a9ff1af23e402462a3ef0f5e80 (patch)
tree006e057254e6694bcba8ad102e9467d1244e8652
parenta7b879ac9c07b7658f37e9a127d3cd845c35ed74 (diff)
downloadchef-dfcf60a2f4cf89a9ff1af23e402462a3ef0f5e80.tar.gz
More yard for chef-utils
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform.rb6
-rw-r--r--chef-utils/lib/chef-utils/dsl/platform_family.rb6
-rw-r--r--chef-utils/lib/chef-utils/dsl/service.rb8
3 files changed, 14 insertions, 6 deletions
diff --git a/chef-utils/lib/chef-utils/dsl/platform.rb b/chef-utils/lib/chef-utils/dsl/platform.rb
index d3d33ece5c..3968a20f15 100644
--- a/chef-utils/lib/chef-utils/dsl/platform.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform.rb
@@ -281,7 +281,7 @@ module ChefUtils
node["platform"] == "dragonfly"
end
- # Determine if the current node is MacOS.
+ # Determine if the current node is macOS.
#
# @param [Chef::Node] node
#
@@ -293,7 +293,7 @@ module ChefUtils
# chef-sugar backcompat method
alias_method :mac_os_x_platform?, :macos_platform?
- # Determine if the current node is gentoo
+ # Determine if the current node is Gentoo.
#
# @param [Chef::Node] node
#
@@ -303,7 +303,7 @@ module ChefUtils
node["platform"] == "gentoo"
end
- # Determine if the current node is slackware.
+ # Determine if the current node is Slackware.
#
# @param [Chef::Node] node
#
diff --git a/chef-utils/lib/chef-utils/dsl/platform_family.rb b/chef-utils/lib/chef-utils/dsl/platform_family.rb
index fe96c73150..6fa7b7829b 100644
--- a/chef-utils/lib/chef-utils/dsl/platform_family.rb
+++ b/chef-utils/lib/chef-utils/dsl/platform_family.rb
@@ -92,7 +92,7 @@ module ChefUtils
# chef-sugar backcompat method
alias_method :el?, :rhel?
- # Determine if the current node is a rhel6 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
+ # Determine if the current node is a rhel6 compatible build (Red Hat, CentOS, Oracle or Scientific Linux).
#
# @param [Chef::Node] node
#
@@ -102,7 +102,7 @@ module ChefUtils
node["platform_family"] == "rhel" && node["platform_version"].to_f >= 6.0 && node["platform_version"].to_f < 7.0
end
- # Determine if the current node is a rhel7 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
+ # Determine if the current node is a rhel7 compatible build (Red Hat, CentOS, Oracle or Scientific Linux).
#
# @param [Chef::Node] node
#
@@ -112,7 +112,7 @@ module ChefUtils
node["platform_family"] == "rhel" && node["platform_version"].to_f >= 7.0 && node["platform_version"].to_f < 8.0
end
- # Determine if the current node is a rhel8 compatible build (Red Hat, CentOS, Oracle or Scientific Linux)
+ # Determine if the current node is a rhel8 compatible build (Red Hat, CentOS, Oracle or Scientific Linux).
#
# @param [Chef::Node] node
#
diff --git a/chef-utils/lib/chef-utils/dsl/service.rb b/chef-utils/lib/chef-utils/dsl/service.rb
index da4ea6c8a1..41478f85fe 100644
--- a/chef-utils/lib/chef-utils/dsl/service.rb
+++ b/chef-utils/lib/chef-utils/dsl/service.rb
@@ -66,6 +66,14 @@ module ChefUtils
file_exist?("/sbin/chkconfig")
end
+ #
+ # Returns if a particular service exists for a particular service init system. Init systems may be :initd, :upstart, :etc_rcd, :xinetd, and :systemd. Example: service_script_exist?(:systemd, 'ntpd')
+ #
+ # @param [Symbol] type The type of init system. :initd, :upstart, :xinetd, :etc_rcd, or :systemd
+ # @param [String] script The name of the service
+ #
+ # @return [Boolean]
+ #
def service_script_exist?(type, script)
case type
when :initd