summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrajaktaPurohit <prajakta@opscode.com>2012-12-11 17:21:28 -0800
committerLamont Granquist <lamont@opscode.com>2012-12-19 15:56:12 -0800
commit95cefeed2f69fa79c0cd05d0683289a1e48f9b1e (patch)
tree1fb8e9f3ed058cd2d43180855450b42b14fc3bff
parentb15ad11e243ff3d3aae60fa4dab8cd6a2268de28 (diff)
downloadchef-95cefeed2f69fa79c0cd05d0683289a1e48f9b1e.tar.gz
Fixing code to not continue if hive not found
-rw-r--r--lib/chef/win32/registry.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb
index 4d369b6070..03d34040a9 100644
--- a/lib/chef/win32/registry.rb
+++ b/lib/chef/win32/registry.rb
@@ -77,6 +77,7 @@ class Chef
begin
hive, key = get_hive_and_key(key_path)
rescue Chef::Exceptions::Win32RegKeyMissing
+ return true
end
hive.open(key, ::Win32::Registry::KEY_SET_VALUE | registry_system_architecture) do |reg|
reg.delete_value(value[:name])
@@ -198,8 +199,8 @@ class Chef
end
def data_exists?(key_path, value)
- hive, key = get_hive_and_key(key_path)
key_exists!(key_path)
+ hive, key = get_hive_and_key(key_path)
hive.open(key, ::Win32::Registry::KEY_READ | registry_system_architecture) do |reg|
reg.each do |val_name, val_type, val_data|
if val_name == value[:name] &&