summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-02-03 19:38:50 -0800
committerTim Smith <tsmith84@gmail.com>2020-02-05 09:10:47 -0800
commit3748ef92205371435c3c2c33c2f0492905f3a8e4 (patch)
tree173f5f9ad9c98bfb1de1bd977ee327744b7b01a1
parente0c3ee021f5fd41f52a4376b017346bdf8344895 (diff)
downloadchef-3748ef92205371435c3c2c33c2f0492905f3a8e4.tar.gz
Update yard for better snippet generation
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--chef-utils/lib/chef-utils/dsl/cloud.rb2
-rw-r--r--chef-utils/lib/chef-utils/dsl/virtualization.rb18
2 files changed, 20 insertions, 0 deletions
diff --git a/chef-utils/lib/chef-utils/dsl/cloud.rb b/chef-utils/lib/chef-utils/dsl/cloud.rb
index 32911609cc..734c7412aa 100644
--- a/chef-utils/lib/chef-utils/dsl/cloud.rb
+++ b/chef-utils/lib/chef-utils/dsl/cloud.rb
@@ -76,6 +76,7 @@ module ChefUtils
def eucalyptus?(node = __getnode)
node.key?("eucalyptus")
end
+ # chef-sugar backcompat method
alias_method :euca?, :eucalyptus?
# Return true if the current current node is in Linode.
@@ -121,6 +122,7 @@ module ChefUtils
def digital_ocean?(node = __getnode)
node.key?("digital_ocean")
end
+ # chef-sugar backcompat method
alias_method :digitalocean?, :digital_ocean?
# Return true if the current current node is in SoftLayer.
diff --git a/chef-utils/lib/chef-utils/dsl/virtualization.rb b/chef-utils/lib/chef-utils/dsl/virtualization.rb
index df3a1ac3eb..e04805151e 100644
--- a/chef-utils/lib/chef-utils/dsl/virtualization.rb
+++ b/chef-utils/lib/chef-utils/dsl/virtualization.rb
@@ -25,6 +25,7 @@ module ChefUtils
# Determine if the current node is a KVM guest.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -35,6 +36,7 @@ module ChefUtils
# Determine if the current node is a KVM host.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -45,6 +47,7 @@ module ChefUtils
# Determine if the current node is running in a linux container.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -55,6 +58,7 @@ module ChefUtils
# Determine if the current node is a linux container host.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -65,6 +69,7 @@ module ChefUtils
# Determine if the current node is running under Parallels Desktop.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
# true if the machine is currently running under Parallels Desktop, false
@@ -77,6 +82,7 @@ module ChefUtils
# Determine if the current node is a Parallels Desktop host.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
# true if the machine is currently running under Parallels Desktop, false
@@ -89,6 +95,7 @@ module ChefUtils
# Determine if the current node is a VirtualBox guest.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -99,6 +106,7 @@ module ChefUtils
# Determine if the current node is a VirtualBox host.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -106,11 +114,13 @@ module ChefUtils
node.dig("virtualization", "system") == "vbox" && node.dig("virtualization", "role") == "host"
end
+ # chef-sugar backcompat method
alias_method :virtualbox?, :vbox?
# Determine if the current node is a VMWare guest.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -121,6 +131,7 @@ module ChefUtils
# Determine if the current node is VMware host.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -131,6 +142,7 @@ module ChefUtils
# Determine if the current node is an openvz guest.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -141,6 +153,7 @@ module ChefUtils
# Determine if the current node is an openvz host.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -151,6 +164,7 @@ module ChefUtils
# Determine if the current node is running under any virutalization environment
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -158,11 +172,13 @@ module ChefUtils
node.dig("virtualization", "role") == "guest"
end
+ # chef-sugar backcompat method
alias_method :virtual?, :guest?
# Determine if the current node supports running guests under any virtualization environment
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -173,6 +189,7 @@ module ChefUtils
# Determine if the current node is NOT running under any virtualization environment (plain metal or hypervisor on metal)
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
#
@@ -186,6 +203,7 @@ module ChefUtils
# vagrantup.com domain in the hostname, which is the best API we have.
#
# @param [Chef::Node] node
+ # @since 15.8
#
# @return [Boolean]
# true if the machine is currently running vagrant, false