diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-12-08 18:42:44 -0800 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-12-08 18:42:44 -0800 |
commit | b45a80c61a9d89ddf0d0167c74ecea0abd5fda96 (patch) | |
tree | 1a9af8302c93b466923723115142dfb2e8fa5e0b | |
parent | 4c37b87e6f9e78d60e31fe498f2a9a4460f155b8 (diff) | |
parent | 65d938fbd86e85bd045dcd5c867f7b47de3d1d2b (diff) | |
download | chef-b45a80c61a9d89ddf0d0167c74ecea0abd5fda96.tar.gz |
Merge pull request #2573 from opscode/sersut/bootstrap-context-arity
Restore compatibility with knife-windows
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | lib/chef/knife/core/bootstrap_context.rb | 2 | ||||
-rw-r--r-- | spec/unit/knife/core/bootstrap_context_spec.rb | 4 |
3 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index e43003b81a..053edee359 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ * Cleaned up script and execute provider + specs * Added deprecation warnings around the use of command attribute in script resources * `path` attribute of `execute` resource is restored to provide backwards compatibility with Chef 11. +* 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 ffc36436ec..f7fee023de 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 af8fa3f698..e7d2464fa1 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 expect(bootstrap_context.start_chef).to eq "chef-client -j /etc/chef/first-boot.json -E _default" end |