Skip to content

Commit

Permalink
Merge pull request #172 from ai-traders/customize-support-other-provi…
Browse files Browse the repository at this point in the history
…ders

Customize supports other vagrant providers, fixes #171
  • Loading branch information
tyler-ball committed Jun 24, 2015
2 parents cd63047 + 900d1a6 commit 3d8d9f0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions spec/kitchen/driver/vagrant_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,28 @@
RUBY
end
end

context "for openstack provider" do

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

it "adds a line for each element in :customize" do
config[:customize] = {
:key1 => "some string value",
:key2 => 22,
:key3 => false
}
cmd

expect(vagrantfile).to match(regexify(<<-RUBY.gsub(/^ {8}/, "").chomp))
c.vm.provider :openstack do |p|
p.key1 = "some string value"
p.key2 = 22
p.key3 = false
end
RUBY
end
end
end

def debug_lines
Expand Down
6 changes: 6 additions & 0 deletions templates/Vagrantfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ Vagrant.configure("2") do |c|
<% else %>
p.vmx["<%= key %>"] = "<%= value %>"
<% end %>
<% when "openstack" %>
<% if value.is_a? String %>
p.<%= key %> = "<%= value%>"
<% else %>
p.<%= key %> = <%= value%>
<% end %>
<% end %>
<% end %>
end
Expand Down

0 comments on commit 3d8d9f0

Please sign in to comment.