summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Cloke <tylercloke@gmail.com>2016-06-10 14:27:16 -0700
committerTyler Cloke <tylercloke@gmail.com>2016-06-10 14:29:09 -0700
commit33add42728521fdf13ff4276809e673f5128326d (patch)
tree23218151c4779ec37cd243669b470670c2ee8322
parentaa69c960e980f52bb0240fc4880134f58c427584 (diff)
downloadchef-tc/deprecate-chef-cookbook-generate.tar.gz
Deprecate `knife cookbook create` in favor of `chef generate cookbook`.tc/deprecate-chef-cookbook-generate
-rw-r--r--lib/chef/knife/cookbook_create.rb4
-rw-r--r--spec/unit/knife/cookbook_create_spec.rb1
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/knife/cookbook_create.rb b/lib/chef/knife/cookbook_create.rb
index 950de380f8..ccb78bb7a6 100644
--- a/lib/chef/knife/cookbook_create.rb
+++ b/lib/chef/knife/cookbook_create.rb
@@ -56,6 +56,10 @@ class Chef
:description => "Email address of cookbook maintainer"
def run
+ Chef::Log.deprecation <<EOF
+This command is being deprecated in favor of `chef generate cookbook` and will soon return an error.
+Please use `chef generate cookbook` instead of this command.
+EOF
self.config = Chef::Config.merge!(config)
if @name_args.length < 1
show_usage
diff --git a/spec/unit/knife/cookbook_create_spec.rb b/spec/unit/knife/cookbook_create_spec.rb
index 5e343f3db1..f860a8bce8 100644
--- a/spec/unit/knife/cookbook_create_spec.rb
+++ b/spec/unit/knife/cookbook_create_spec.rb
@@ -22,6 +22,7 @@ require "tmpdir"
describe Chef::Knife::CookbookCreate do
before(:each) do
Chef::Config[:node_name] = "webmonkey.example.com"
+ Chef::Config[:treat_deprecation_warnings_as_errors] = false
@knife = Chef::Knife::CookbookCreate.new
@knife.config = {}
@knife.name_args = ["foobar"]