summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/knife/cookbook_site_download.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/knife/cookbook_site_download.rb b/lib/chef/knife/cookbook_site_download.rb
index 43677cfa78..07e0037bd6 100644
--- a/lib/chef/knife/cookbook_site_download.rb
+++ b/lib/chef/knife/cookbook_site_download.rb
@@ -47,7 +47,12 @@ class Chef
def run
if current_cookbook_deprecated?
message = "DEPRECATION: This cookbook has been deprecated. "
- message << "It has been replaced by #{replacement_cookbook}."
+ replacement = replacement_cookbook
+ if !replacement.to_s.strip.empty?
+ message << "It has been replaced by #{replacement}."
+ else
+ message << "No replacement has been defined."
+ end
ui.warn message
unless config[:force]
@@ -105,7 +110,7 @@ class Chef
end
def replacement_cookbook
- File.basename(current_cookbook_data["replacement"])
+ File.basename(current_cookbook_data["replacement"] || "")
end
def specific_cookbook_version_url