summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@getchef.com>2015-02-11 16:02:05 -0800
committerdanielsdeleo <dan@getchef.com>2015-02-11 16:02:49 -0800
commit10ea5e7e33a387eccddca32ea690a517f102eb6d (patch)
treeea688d3af261a583156c5d4480b91f3f3b59be0d
parent417d5c4fa600b7995ea3a4d27a787a35405da446 (diff)
downloadchef-zero-cookbook-artifact-api.tar.gz
STASH - debug output, has one fix for unknown constcookbook-artifact-api
-rw-r--r--lib/chef_zero/data_store/raw_file_store.rb6
-rw-r--r--lib/chef_zero/rest_base.rb4
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef_zero/data_store/raw_file_store.rb b/lib/chef_zero/data_store/raw_file_store.rb
index dce6374..6da7dd9 100644
--- a/lib/chef_zero/data_store/raw_file_store.rb
+++ b/lib/chef_zero/data_store/raw_file_store.rb
@@ -44,18 +44,20 @@ module ChefZero
if destructible
Dir.entries(root).each do |entry|
next if entry == '.' || entry == '..'
- FileUtils.rm_rf(Path.join(root, entry))
+ FileUtils.rm_rf(File.join(root, entry))
end
end
end
def create_dir(path, name, *options)
+ pp create_dir: {path: path, name: name}
real_path = path_to(path, name)
+ pp create_dir_real_path: real_path
if options.include?(:recursive)
FileUtils.mkdir_p(real_path)
else
begin
- Dir.mkdir(File.join(path, name))
+ Dir.mkdir(real_path)
rescue Errno::ENOENT
raise DataNotFoundError.new(path)
rescue Errno::EEXIST
diff --git a/lib/chef_zero/rest_base.rb b/lib/chef_zero/rest_base.rb
index 3fa017a..ec43f5e 100644
--- a/lib/chef_zero/rest_base.rb
+++ b/lib/chef_zero/rest_base.rb
@@ -116,10 +116,12 @@ module ChefZero
rest_path ||= request.rest_path
begin
data_store.set(rest_path, data, *options, :requestor => request.requestor)
- rescue DataStore::DataNotFoundError
+ rescue DataStore::DataNotFoundError => e
if options.include?(:data_store_exceptions)
raise
else
+ puts e
+ puts e.backtrace
raise RestErrorResponse.new(404, "Object not found: #{build_uri(request.base_uri, request.rest_path)}")
end
end