From fcd014b4a7ddead4e0b3c9756b28d3a5ca62757f Mon Sep 17 00:00:00 2001 From: Ewa Czechowska Date: Thu, 21 May 2015 17:59:00 +0200 Subject: [PATCH 1/4] #171 customize supports other vagrant providers --- templates/Vagrantfile.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/Vagrantfile.erb b/templates/Vagrantfile.erb index 833a93f0..9636c59a 100644 --- a/templates/Vagrantfile.erb +++ b/templates/Vagrantfile.erb @@ -118,6 +118,8 @@ Vagrant.configure("2") do |c| <% else %> p.vmx["<%= key %>"] = "<%= value %>" <% end %> + <% else %> + p.<%= key %> = "<%= value%>" <% end %> <% end %> end From 0feadb9dfd0aa077b40477e508657661f575b3d6 Mon Sep 17 00:00:00 2001 From: Ewa Czechowska Date: Tue, 26 May 2015 19:43:12 +0200 Subject: [PATCH 2/4] #171 customize supports non-string values --- templates/Vagrantfile.erb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/Vagrantfile.erb b/templates/Vagrantfile.erb index 9636c59a..d3c72617 100644 --- a/templates/Vagrantfile.erb +++ b/templates/Vagrantfile.erb @@ -118,8 +118,12 @@ Vagrant.configure("2") do |c| <% else %> p.vmx["<%= key %>"] = "<%= value %>" <% end %> - <% else %> + <% else # other vagrant provider %> + <% if value.is_a? String %> p.<%= key %> = "<%= value%>" + <% else %> + p.<%= key %> = <%= value%> + <% end %> <% end %> <% end %> end From df35ee7e3b83d8d00ab3a9a5e896d31f2d791356 Mon Sep 17 00:00:00 2001 From: Ewa Czechowska Date: Fri, 29 May 2015 15:20:23 +0200 Subject: [PATCH 3/4] #171 support openstack provider in customize; added test --- spec/kitchen/driver/vagrant_spec.rb | 22 ++++++++++++++++++++++ templates/Vagrantfile.erb | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/spec/kitchen/driver/vagrant_spec.rb b/spec/kitchen/driver/vagrant_spec.rb index 4970f900..efb53387 100644 --- a/spec/kitchen/driver/vagrant_spec.rb +++ b/spec/kitchen/driver/vagrant_spec.rb @@ -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 diff --git a/templates/Vagrantfile.erb b/templates/Vagrantfile.erb index d3c72617..11e39065 100644 --- a/templates/Vagrantfile.erb +++ b/templates/Vagrantfile.erb @@ -118,7 +118,7 @@ Vagrant.configure("2") do |c| <% else %> p.vmx["<%= key %>"] = "<%= value %>" <% end %> - <% else # other vagrant provider %> + <% when "openstack" %> <% if value.is_a? String %> p.<%= key %> = "<%= value%>" <% else %> From 900d1a6882e6b2cc03d6938ad5f239bb6c5777ff Mon Sep 17 00:00:00 2001 From: Ewa Czechowska Date: Fri, 29 May 2015 15:46:17 +0200 Subject: [PATCH 4/4] #171 fix style issues --- spec/kitchen/driver/vagrant_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/kitchen/driver/vagrant_spec.rb b/spec/kitchen/driver/vagrant_spec.rb index efb53387..627c5322 100644 --- a/spec/kitchen/driver/vagrant_spec.rb +++ b/spec/kitchen/driver/vagrant_spec.rb @@ -1385,7 +1385,7 @@ p.key3 = false end RUBY - end + end end end