summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-12-08 18:42:44 -0800
committerSerdar Sutay <serdar@opscode.com>2014-12-08 18:45:29 -0800
commit767531c46719f1274a0d4d210cc3ff9c0f50b97d (patch)
treeb051d4b53673f70657002c55e4afbd43b342c1c1
parentbc87ec6ecf8eae8ec13a64b97dc1da551b516497 (diff)
downloadchef-767531c46719f1274a0d4d210cc3ff9c0f50b97d.tar.gz
Merge pull request #2573 from opscode/sersut/bootstrap-context-arity
Restore compatibility with knife-windows Conflicts: CHANGELOG.md
-rw-r--r--CHANGELOG.md1
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb2
-rw-r--r--spec/unit/knife/core/bootstrap_context_spec.rb4
3 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5928d7bf90..f3b2f9c7ff 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
## 12.0.1
* [Issue 2552](https://github.com/opscode/chef/issues/2552) Create constant for LWRP before calling `provides`
* [Issue 2545](https://github.com/opscode/chef/issues/2545) `path` attribute of `execute` resource is restored to provide backwards compatibility with Chef 11.
+* [Issue 2565](https://github.com/opscode/chef/issues/2565) Fix `Chef::Knife::Core::BootstrapContext` constructor for knife-windows compat.
## 12.0.0
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index e681d7a49b..3833182c70 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -30,7 +30,7 @@ class Chef
#
class BootstrapContext
- def initialize(config, run_list, chef_config, secret)
+ def initialize(config, run_list, chef_config, secret = nil)
@config = config
@run_list = run_list
@chef_config = chef_config
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb
index cd53088419..6f7adfcf57 100644
--- a/spec/unit/knife/core/bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/bootstrap_context_spec.rb
@@ -34,6 +34,10 @@ describe Chef::Knife::Core::BootstrapContext do
subject(:bootstrap_context) { described_class.new(config, run_list, chef_config, secret) }
+ it "initializes with Chef 11 parameters" do
+ expect{described_class.new(config, run_list, chef_config)}.not_to raise_error
+ end
+
it "runs chef with the first-boot.json in the _default environment" do
bootstrap_context.start_chef.should eq "chef-client -j /etc/chef/first-boot.json -E _default"
end