summaryrefslogtreecommitdiff
path: root/lib/chef/knife/deps.rb
diff options
context:
space:
mode:
authorjkeiser <jkeiser@opscode.com>2013-01-04 09:12:57 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-06-07 13:12:15 -0700
commita0e4d02c49054a383790e3fd36a88a3ba35cb142 (patch)
treea3dfb26e0b6bd5817b39343ac0d9d97ff4f53a05 /lib/chef/knife/deps.rb
parent6afb866c55e9a4f69fa5474f494e807565ff693b (diff)
downloadchef-a0e4d02c49054a383790e3fd36a88a3ba35cb142.tar.gz
Make deps report error when file does not exist
Diffstat (limited to 'lib/chef/knife/deps.rb')
-rw-r--r--lib/chef/knife/deps.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/knife/deps.rb b/lib/chef/knife/deps.rb
index 5217564a08..4eda036945 100644
--- a/lib/chef/knife/deps.rb
+++ b/lib/chef/knife/deps.rb
@@ -21,6 +21,8 @@ class Chef
:boolean => true,
:description => "List dependencies on the server instead of the local filesystem"
+ attr_accessor :exit_code
+
def run
if config[:recurse] == false && !config[:tree]
ui.error "--no-recurse requires --tree"
@@ -39,6 +41,7 @@ class Chef
end
end
end
+ exit exit_code if exit_code
end
def print_flattened_dependencies(entry, dependencies)
@@ -69,10 +72,11 @@ class Chef
object = entry.chef_object
rescue Chef::ChefFS::FileSystem::NotFoundError
ui.error "#{format_path(entry.path)}: No such file or directory"
+ self.exit_code = 2
return []
end
if !object
- ui.error "#{format_path(entry.path)} is not a Chef object!"
+ # If it's not a Chef object, it has no deps
return []
end