diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-23 15:55:18 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-03-23 15:55:18 -0700 |
commit | 53b4ae6633b3d2e4e9e285bd40b399b40cc23b81 (patch) | |
tree | 9afb5f72f55d75f6d70769e51a2e3c33cc1f43c5 /lib | |
parent | a421cf39a76a80da8154c93f26d3c665afa8f768 (diff) | |
download | chef-53b4ae6633b3d2e4e9e285bd40b399b40cc23b81.tar.gz |
windows fixes for ruby 2.2.4
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/win32/registry.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index bccd2e3c72..613994295c 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -61,7 +61,9 @@ class Chef end def set_value(key_path, value) - Chef::Log.debug("Updating value #{value[:name]} in registry key #{key_path} with type #{value[:type]} and data #{value[:data]}") + 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}") key_exists!(key_path) hive, key = get_hive_and_key(key_path) if value_exists?(key_path, value) @@ -70,13 +72,13 @@ class Chef 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]), value[:data]) + reg.write(value[:name], get_type_from_name(value[:type]), data) end Chef::Log.debug("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]), value[:data]) + reg.write(value[:name], get_type_from_name(value[:type]), data) end Chef::Log.debug("Value #{value[:name]} in registry key #{key_path} created") end |