Commit 55ea9ff6 authored by Matt Whiteley's avatar Matt Whiteley
Browse files

add support for softlayer cloud

parent 986593df
......@@ -103,6 +103,7 @@ end
- `openstack?`
- `cloudstack?`
- `rackspace?`
- `softlayer?`
#### Examples
```ruby
......
......@@ -139,6 +139,18 @@ class Chef
def digitalocean?(node)
node.key?('digital_ocean')
end
#
# Return true if the current current node is in SoftLayer
#
# @param [Chef::Node] node
# the node to check
#
# @return [Boolean]
#
def softlayer?(node)
node.key?('softlayer')
end
end
module DSL
......@@ -172,6 +184,9 @@ class Chef
# @see Chef::Sugar::Cloud#digitalocean?
def digitalocean?; Chef::Sugar::Cloud.digitalocean?(node); end
# @see Chef::Sugar::Cloud#softlayer?
def softlayer?; Chef::Sugar::Cloud.softlayer?(node); end
end
end
end
......@@ -134,4 +134,16 @@ describe Chef::Sugar::Cloud do
expect(described_class.digitalocean?(node)).to be false
end
end
describe '#softlayer?' do
it 'is true when the node is on softlayer' do
node = { 'softlayer' => nil }
expect(described_class.softlayer?(node)).to be true
end
it 'is false when the node is not on softlayer' do
node = {}
expect(described_class.softlayer?(node)).to be false
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment