summaryrefslogtreecommitdiff
path: root/lib/chef/win32
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-03-23 13:05:13 +0000
committerTim Smith <tsmith@chef.io>2018-03-26 10:34:39 -0700
commit97c1dd6f1cac6d97e85d05039cad8b28596141ba (patch)
treed8a97c0f7016986a2cc264aa50ae345638ed026c /lib/chef/win32
parent1b81f35e023bcdc87e410c641545e849298de5c3 (diff)
downloadchef-97c1dd6f1cac6d97e85d05039cad8b28596141ba.tar.gz
mechanical conversion of most debug log statements to trace
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/win32')
-rw-r--r--lib/chef/win32/mutex.rb2
-rw-r--r--lib/chef/win32/registry.rb30
-rw-r--r--lib/chef/win32/security.rb2
3 files changed, 17 insertions, 17 deletions
diff --git a/lib/chef/win32/mutex.rb b/lib/chef/win32/mutex.rb
index a14a160f56..2264479734 100644
--- a/lib/chef/win32/mutex.rb
+++ b/lib/chef/win32/mutex.rb
@@ -55,7 +55,7 @@ class Chef
when WAIT_ABANDONED
# Previous owner of the mutex died before it can release the
# mutex. Log a warning and continue.
- Chef::Log.debug "Existing owner of the mutex exited prematurely."
+ Chef::Log.trace "Existing owner of the mutex exited prematurely."
break
when WAIT_OBJECT_0
# Mutex is successfully acquired.
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
diff --git a/lib/chef/win32/security.rb b/lib/chef/win32/security.rb
index 374d31e8a3..2f903d6c93 100644
--- a/lib/chef/win32/security.rb
+++ b/lib/chef/win32/security.rb
@@ -645,7 +645,7 @@ class Chef
# display token elevation details
token_elevation_type = get_token_information_elevation_type(process_token)
- Chef::Log.debug("Token Elevation Type: #{token_elevation_type}")
+ Chef::Log.trace("Token Elevation Type: #{token_elevation_type}")
elevation_result = FFI::Buffer.new(:ulong)
elevation_result_size = FFI::MemoryPointer.new(:uint32)