summaryrefslogtreecommitdiff
path: root/lib/chef/win32/registry.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/win32/registry.rb')
-rw-r--r--lib/chef/win32/registry.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb
index 4a1dbe3eac..1193911b00 100644
--- a/lib/chef/win32/registry.rb
+++ b/lib/chef/win32/registry.rb
@@ -63,30 +63,30 @@ class Chef
def set_value(key_path, value)
data = value[:data]
data = data.to_s if value[:type] == :string
- Chef::Log.debug("Updating value #{value[:name]} in registry key #{key_path} with type #{value[:type]} and data #{data}")
+ Chef::Log.trace("Updating value #{value[:name]} in registry key #{key_path} with type #{value[:type]} and data #{data}")
key_exists!(key_path)
hive, key = get_hive_and_key(key_path)
if value_exists?(key_path, value)
if data_exists?(key_path, value)
- Chef::Log.debug("Value #{value[:name]} in registry key #{key_path} already had those values, not updated")
+ Chef::Log.trace("Value #{value[:name]} in registry key #{key_path} already had those values, not updated")
return false
else
hive.open(key, ::Win32::Registry::KEY_SET_VALUE | ::Win32::Registry::KEY_QUERY_VALUE | registry_system_architecture) do |reg|
reg.write(value[:name], get_type_from_name(value[:type]), data)
end
- Chef::Log.debug("Value #{value[:name]} in registry key #{key_path} updated")
+ Chef::Log.trace("Value #{value[:name]} in registry key #{key_path} updated")
end
else
hive.open(key, ::Win32::Registry::KEY_SET_VALUE | ::Win32::Registry::KEY_QUERY_VALUE | registry_system_architecture) do |reg|
reg.write(value[:name], get_type_from_name(value[:type]), data)
end
- Chef::Log.debug("Value #{value[:name]} in registry key #{key_path} created")
+ Chef::Log.trace("Value #{value[:name]} in registry key #{key_path} created")
end
true
end
def delete_value(key_path, value)
- Chef::Log.debug("Deleting value #{value[:name]} from registry key #{key_path}")
+ Chef::Log.trace("Deleting value #{value[:name]} from registry key #{key_path}")
if value_exists?(key_path, value)
begin
hive, key = get_hive_and_key(key_path)
@@ -95,38 +95,38 @@ class Chef
end
hive.open(key, ::Win32::Registry::KEY_SET_VALUE | registry_system_architecture) do |reg|
reg.delete_value(value[:name])
- Chef::Log.debug("Deleted value #{value[:name]} from registry key #{key_path}")
+ Chef::Log.trace("Deleted value #{value[:name]} from registry key #{key_path}")
end
else
- Chef::Log.debug("Value #{value[:name]} in registry key #{key_path} does not exist, not updated")
+ Chef::Log.trace("Value #{value[:name]} in registry key #{key_path} does not exist, not updated")
end
true
end
def create_key(key_path, recursive)
- Chef::Log.debug("Creating registry key #{key_path}")
+ Chef::Log.trace("Creating registry key #{key_path}")
if keys_missing?(key_path)
if recursive == true
- Chef::Log.debug("Registry key #{key_path} has missing subkeys, and recursive specified, creating them....")
+ Chef::Log.trace("Registry key #{key_path} has missing subkeys, and recursive specified, creating them....")
create_missing(key_path)
else
raise Chef::Exceptions::Win32RegNoRecursive, "Registry key #{key_path} has missing subkeys, and recursive not specified"
end
end
if key_exists?(key_path)
- Chef::Log.debug("Registry key #{key_path} already exists, doing nothing")
+ Chef::Log.trace("Registry key #{key_path} already exists, doing nothing")
else
hive, key = get_hive_and_key(key_path)
hive.create(key, ::Win32::Registry::KEY_WRITE | registry_system_architecture)
- Chef::Log.debug("Registry key #{key_path} created")
+ Chef::Log.trace("Registry key #{key_path} created")
end
true
end
def delete_key(key_path, recursive)
- Chef::Log.debug("Deleting registry key #{key_path}")
+ Chef::Log.trace("Deleting registry key #{key_path}")
unless key_exists?(key_path)
- Chef::Log.debug("Registry key #{key_path}, does not exist, not deleting")
+ Chef::Log.trace("Registry key #{key_path}, does not exist, not deleting")
return true
end
if has_subkeys?(key_path) && !recursive
@@ -142,7 +142,7 @@ class Chef
hive.open(key_parent, ::Win32::Registry::KEY_WRITE | registry_system_architecture) do |reg|
reg.delete_key(key, recursive)
end
- Chef::Log.debug("Registry key #{key_path} deleted")
+ Chef::Log.trace("Registry key #{key_path} deleted")
true
end
@@ -357,7 +357,7 @@ class Chef
missing_key_arr.each do |intermediate_key|
existing_key_path = existing_key_path << "\\" << intermediate_key
if !key_exists?(existing_key_path)
- Chef::Log.debug("Recursively creating registry key #{existing_key_path}")
+ Chef::Log.trace("Recursively creating registry key #{existing_key_path}")
hive.create(get_key(existing_key_path), ::Win32::Registry::KEY_ALL_ACCESS | registry_system_architecture)
end
end