diff options
author | Per Lundberg <per.lundberg@ecraft.com> | 2017-07-18 12:41:28 +0300 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2017-07-24 06:25:06 -0400 |
commit | 2ca144e885e5f8cad8405f899ac582d002c93729 (patch) | |
tree | 8eaab0ee70429756f175c020ccee93fa79d99d61 /lib | |
parent | 19aac6712984d3568dc9ec25c1b38c56938cf6ca (diff) | |
download | chef-2ca144e885e5f8cad8405f899ac582d002c93729.tar.gz |
Handle display names with trailing spaces
Closes #6217.
The reason why we do `to_s.rstrip` is to handle the (potentially weird case of) `display_name` being `nil`, in which case we will otherwise get an unfriendly Ruby error message.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/package/windows/registry_uninstall_entry.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/package/windows/registry_uninstall_entry.rb b/lib/chef/provider/package/windows/registry_uninstall_entry.rb index 03f6ff318e..64889e1649 100644 --- a/lib/chef/provider/package/windows/registry_uninstall_entry.rb +++ b/lib/chef/provider/package/windows/registry_uninstall_entry.rb @@ -40,7 +40,7 @@ class Chef begin entry = reg.open(key, desired) display_name = read_registry_property(entry, "DisplayName") - if display_name == package_name + if display_name.to_s.rstrip == package_name quiet_uninstall_string = RegistryUninstallEntry.read_registry_property(entry, "QuietUninstallString") entries.push(quiet_uninstall_string_key?(quiet_uninstall_string, hkey, key, entry)) end |