From ed1c219a07180bb525d2eaa915625656bdefc888 Mon Sep 17 00:00:00 2001 From: Trey Briggs Date: Tue, 22 Sep 2015 23:26:02 -0500 Subject: [PATCH 1/2] version is a Symbol, convert to String before concat. --- plugins/provisioners/chef/cap/windows/chef_installed.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/provisioners/chef/cap/windows/chef_installed.rb b/plugins/provisioners/chef/cap/windows/chef_installed.rb index c95ea8498..6ab3bd4b7 100644 --- a/plugins/provisioners/chef/cap/windows/chef_installed.rb +++ b/plugins/provisioners/chef/cap/windows/chef_installed.rb @@ -7,7 +7,7 @@ module VagrantPlugins # @return [true, false] def self.chef_installed(machine, version) if version != :latest - command = 'if ((&knife --version) -Match "Chef: "' + version + '"){ exit 0 } else { exit 1 }' + command = 'if ((&knife --version) -Match "Chef: "' + version.to_s + '"){ exit 0 } else { exit 1 }' else command = 'if ((&knife --version) -Match "Chef: *"){ exit 0 } else { exit 1 }' end From a5b6e23e201f57dcd2ef66373046ca4be921b349 Mon Sep 17 00:00:00 2001 From: Trey Briggs Date: Tue, 22 Sep 2015 23:28:14 -0500 Subject: [PATCH 2/2] Removed extra quote in powershell command. --- plugins/provisioners/chef/cap/windows/chef_installed.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/provisioners/chef/cap/windows/chef_installed.rb b/plugins/provisioners/chef/cap/windows/chef_installed.rb index 6ab3bd4b7..b08794833 100644 --- a/plugins/provisioners/chef/cap/windows/chef_installed.rb +++ b/plugins/provisioners/chef/cap/windows/chef_installed.rb @@ -7,7 +7,7 @@ module VagrantPlugins # @return [true, false] def self.chef_installed(machine, version) if version != :latest - command = 'if ((&knife --version) -Match "Chef: "' + version.to_s + '"){ exit 0 } else { exit 1 }' + command = 'if ((&knife --version) -Match "Chef: ' + version.to_s + '"){ exit 0 } else { exit 1 }' else command = 'if ((&knife --version) -Match "Chef: *"){ exit 0 } else { exit 1 }' end