summaryrefslogtreecommitdiff
path: root/lib/chef_zero/rest_base.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-05-24 23:17:37 -0700
committerJohn Keiser <jkeiser@opscode.com>2013-05-24 23:17:37 -0700
commit08f80dd5c9cc1cd72be7d1566cce61f9754aaa4d (patch)
treefe7999bec177bab72dc99affee51ae8377df171f /lib/chef_zero/rest_base.rb
parenta11dc4775634b1b179e34d32eb51685449f316ba (diff)
downloadchef-zero-08f80dd5c9cc1cd72be7d1566cce61f9754aaa4d.tar.gz
More rounded support for data stores
Diffstat (limited to 'lib/chef_zero/rest_base.rb')
-rw-r--r--lib/chef_zero/rest_base.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/chef_zero/rest_base.rb b/lib/chef_zero/rest_base.rb
index 5371a0a..9a60ffb 100644
--- a/lib/chef_zero/rest_base.rb
+++ b/lib/chef_zero/rest_base.rb
@@ -39,7 +39,7 @@ module ChefZero
def get_data(request, rest_path=nil, *options)
rest_path ||= request.rest_path
begin
- data_store.get(rest_path)
+ data_store.get(rest_path, request)
rescue DataStore::DataNotFoundError
if options.include?(:nil)
nil
@@ -67,6 +67,15 @@ module ChefZero
end
end
+ def delete_data_dir(request, rest_path, *options)
+ rest_path ||= request.rest_path
+ begin
+ data_store.delete_dir(rest_path)
+ rescue DataStore::DataNotFoundError
+ raise RestErrorResponse.new(404, "Object not found: #{build_uri(request.base_uri, request.rest_path)}")
+ end
+ end
+
def set_data(request, rest_path, data, *options)
rest_path ||= request.rest_path
begin