Skip to content

Commit

Permalink
Support SoftLayer disk_capacity configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Martin authored and fnichol committed Mar 23, 2015
1 parent 3df523d commit 706256a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
16 changes: 16 additions & 0 deletions spec/kitchen/driver/vagrant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,22 @@

before { config[:provider] = "softlayer" }

it "adds a line for disk_capacity" do
config[:customize] = {
:disk_capacity => {
:"0" => 25,
:"2" => 100
}
}
cmd

expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
c.vm.provider :softlayer do |p|
p.disk_capacity = {:"0"=>25, :"2"=>100}
end
RUBY
end

it "adds a line for each element in :customize" do
config[:customize] = {
:a_key => "some value",
Expand Down
8 changes: 7 additions & 1 deletion templates/Vagrantfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,14 @@ Vagrant.configure("2") do |c|
<% end %>
<% when "parallels" %>
p.customize ["set", :id, "--<%= key.to_s.gsub('_', '-') %>", "<%= value %>"]
<% when "rackspace", "softlayer" %>
<% when "rackspace" %>
p.<%= key %> = "<%= value%>"
<% when "softlayer" %>
<% if key == :disk_capacity %>
p.<%= key %> = <%= value %>
<% else %>
p.<%= key %> = "<%= value %>"
<% end %>
<% when "virtualbox" %>
p.customize ["modifyvm", :id, "--<%= key %>", "<%= value %>"]
<% when /^vmware_/ %>
Expand Down

0 comments on commit 706256a

Please sign in to comment.