summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc A. Paradise <marc.paradise@gmail.com>2021-04-29 21:51:02 -0400
committerMarc A. Paradise <marc.paradise@gmail.com>2021-04-29 23:02:25 -0400
commit3742cbd1fa20de3bfce470a4c3a87058e2c8bc9d (patch)
treea32a8951447ee738d6d36042d6cf2122f62b3706
parent0f066ec30570368733bc257bc141f4d3eb95393c (diff)
downloadchef-3742cbd1fa20de3bfce470a4c3a87058e2c8bc9d.tar.gz
[drop] testing - debug output
Signed-off-by: Marc A. Paradise <marc.paradise@gmail.com>
-rw-r--r--knife/lib/chef/knife/core/object_loader.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/knife/lib/chef/knife/core/object_loader.rb b/knife/lib/chef/knife/core/object_loader.rb
index abfcb7b0cc..5dec55bebf 100644
--- a/knife/lib/chef/knife/core/object_loader.rb
+++ b/knife/lib/chef/knife/core/object_loader.rb
@@ -40,6 +40,7 @@ class Chef
def load_from(repo_location, *components)
unless object_file = find_file(repo_location, *components)
+ puts "Could not find or open file from #{components} '#{components.last}' in current directory or in '#{repo_location}/#{components.join("/")}'"
ui.error "Could not find or open file '#{components.last}' in current directory or in '#{repo_location}/#{components.join("/")}'"
exit 1
end
@@ -48,13 +49,19 @@ class Chef
# When someone makes this awesome, please update the above error message.
def find_file(repo_location, *components)
+ puts "AAAA #{Dir.pwd} + #{File.expand_path(components.last)}"
if file_exists_and_is_readable?(File.expand_path( components.last ))
+ puts "AAAA <"
File.expand_path( components.last )
else
+ puts "AAAB #{Dir.pwd} + #{File.expand_path(components.last)}"
relative_path = File.join(Dir.pwd, repo_location, *components)
+ puts "AAAB #{Dir.pwd} + #{relative_path}"
if file_exists_and_is_readable?(relative_path)
+ puts "AAAC #{relative_path}"
relative_path
else
+ puts "AAAD nil"
nil
end
end
@@ -106,6 +113,8 @@ class Chef
end
def file_exists_and_is_readable?(file)
+ puts "AABA: #{file} #{File.exist?(file)} #{File.readable?(file)}"
+ puts "AABB: #{Dir["/workdir/knife/spec/**/*"]}"
File.exist?(file) && File.readable?(file)
end