lib/chef/sugar/virtualization.rb in chef-sugar-4.1.0 vs lib/chef/sugar/virtualization.rb in chef-sugar-4.2.0
- old
+ new
@@ -44,10 +44,23 @@
def lxc?(node)
node.key?('virtualization') && node['virtualization']['system'] == 'lxc'
end
#
+ # Determine if the current node is running under Parallels Desktop.
+ #
+ # @param [Chef::Node] node
+ #
+ # @return [Boolean]
+ # true if the machine is currently running under Parallels Desktop, false
+ # otherwise
+ #
+ def parallels?(node)
+ node.key?('virtualization') && node['virtualization']['system'] == 'Parallels'
+ end
+
+ #
# Determine if the current node is running under VirtualBox.
#
# @param [Chef::Node] node
#
# @return [Boolean]
@@ -83,37 +96,56 @@
def openvz?(node)
node.key?('virtualization') && node['virtualization']['system'] == 'openvz'
end
def virtual?(node)
- openvz?(node) || vmware?(node) || virtualbox?(node) || lxc?(node) || kvm?(node)
+ openvz?(node) || vmware?(node) || virtualbox?(node) || parallels?(node) || lxc?(node) || kvm?(node)
end
def physical?(node)
!virtual?(node)
end
end
module DSL
# @see Chef::Sugar::Virtualization#kvm?
- def kvm?; Chef::Sugar::Virtualization.kvm?(node); end
+ def kvm?
+ Chef::Sugar::Virtualization.kvm?(node)
+ end
# @see Chef::Sugar::Virtualization#lxc?
- def lxc?; Chef::Sugar::Virtualization.lxc?(node); end
+ def lxc?
+ Chef::Sugar::Virtualization.lxc?(node)
+ end
+ # @see Chef::Sugar::Virtualization#parallels?
+ def parallels?
+ Chef::Sugar::Virtualization.parallels?(node)
+ end
+
# @see Chef::Sugar::Virtualization#virtualbox?
- def virtualbox?; Chef::Sugar::Virtualization.virtualbox?(node); end
+ def virtualbox?
+ Chef::Sugar::Virtualization.virtualbox?(node)
+ end
# @see Chef::Sugar::Virtualization#vmware?
- def vmware?; Chef::Sugar::Virtualization.vmware?(node); end
+ def vmware?
+ Chef::Sugar::Virtualization.vmware?(node)
+ end
# @see Chef::Sugar::Virtualization#openvz?
- def openvz?; Chef::Sugar::Virtualization.openvz?(node); end
+ def openvz?
+ Chef::Sugar::Virtualization.openvz?(node)
+ end
# @see Chef::Sugar::Virtualization#virtual?
- def virtual?; Chef::Sugar::Virtualization.virtual?(node); end
-
+ def virtual?
+ Chef::Sugar::Virtualization.virtual?(node)
+ end
+
# @see Chef::Sugar::Virtualization#physical?
- def physical?; Chef::Sugar::Virtualization.physical?(node); end
+ def physical?
+ Chef::Sugar::Virtualization.physical?(node)
+ end
end
end
end