summaryrefslogtreecommitdiff
path: root/lib/chef/win32/registry.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@opscode.com>2012-11-20 14:09:03 -0800
committerLamont Granquist <lamont@opscode.com>2012-12-19 15:54:40 -0800
commitafff142b2502134696e9cefb62a51b086a55f19b (patch)
tree44eefbcc33cf6ac8ec99f7c8320b5662fbd22df7 /lib/chef/win32/registry.rb
parent9fe5f2d9a54db59448e7acea2cf26640b820bc1b (diff)
downloadchef-afff142b2502134696e9cefb62a51b086a55f19b.tar.gz
adding exceptions for missing recursive option
Diffstat (limited to 'lib/chef/win32/registry.rb')
-rw-r--r--lib/chef/win32/registry.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb
index 80b7239a90..406897ded6 100644
--- a/lib/chef/win32/registry.rb
+++ b/lib/chef/win32/registry.rb
@@ -107,9 +107,7 @@ class Chef
Chef::Log.debug("Registry key #{key_path} has missing subkeys, and recursive specified, creating them....")
create_missing(key_path)
else
- Chef::Log.debug("Registry key #{key_path} has missing subkeys, and recursive not specified, doing nothing")
- #XXX: RAISE ERROR?
- return
+ raise Chef::Exceptions::Win32RegNoRecursive, "Registry key #{key_path} has missing subkeys, and recursive not specified"
end
end
if key_exists?(key_path)
@@ -138,8 +136,7 @@ class Chef
reg.delete_key(key_to_delete,recursive)
end
else
- Chef::Log.debug("Registry key #{key_path} has subkeys and recursive not specified, doing nothing")
- # XXX: RAISE ERROR?
+ raise Chef::Exceptions::Win32RegNoRecursive, "Registry key #{key_path} has subkeys, and recursive not specified"
end
else
hive.open(key_parent, ::Win32::Registry::KEY_WRITE | registry_system_architecture) do |reg|