diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-03 13:11:13 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-07-05 12:41:04 -0700 |
commit | 9802d7c075c8b7dae42dbcecd92d492f7fa128ac (patch) | |
tree | 0d13de92dc631081f9bcdaddedd6294051e3423b /lib/chef/win32 | |
parent | 4978a9a8a402477f3b35f43404701d6a5cf26fa1 (diff) | |
download | chef-9802d7c075c8b7dae42dbcecd92d492f7fa128ac.tar.gz |
Style/NegatedIf
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/eventlog.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/memory.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/registry.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/security/security_descriptor.rb | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/win32/eventlog.rb b/lib/chef/win32/eventlog.rb index 4997c0c4c0..ca15acf3d8 100644 --- a/lib/chef/win32/eventlog.rb +++ b/lib/chef/win32/eventlog.rb @@ -17,7 +17,7 @@ # if Chef::Platform.windows? - if !defined? Chef::Win32EventLogLoaded + unless defined? Chef::Win32EventLogLoaded if defined? Windows::Constants %i{INFINITE WAIT_FAILED FORMAT_MESSAGE_IGNORE_INSERTS ERROR_INSUFFICIENT_BUFFER}.each do |c| # These are redefined in 'win32/eventlog' diff --git a/lib/chef/win32/memory.rb b/lib/chef/win32/memory.rb index 853551f183..1ea6375e01 100644 --- a/lib/chef/win32/memory.rb +++ b/lib/chef/win32/memory.rb @@ -67,7 +67,7 @@ class Chef # Free memory allocated using local_alloc def self.local_free(pointer) result = LocalFree(pointer) - if !result.null? + unless result.null? Chef::ReservedNames::Win32::Error.raise! end end diff --git a/lib/chef/win32/registry.rb b/lib/chef/win32/registry.rb index 94311f7954..90bc35143a 100644 --- a/lib/chef/win32/registry.rb +++ b/lib/chef/win32/registry.rb @@ -361,7 +361,7 @@ class Chef hive, key = get_hive_and_key(key_path) missing_key_arr.each do |intermediate_key| existing_key_path = existing_key_path << "\\" << intermediate_key - if !key_exists?(existing_key_path) + unless key_exists?(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 diff --git a/lib/chef/win32/security/security_descriptor.rb b/lib/chef/win32/security/security_descriptor.rb index 722d8faf5d..3d109e60bb 100644 --- a/lib/chef/win32/security/security_descriptor.rb +++ b/lib/chef/win32/security/security_descriptor.rb @@ -41,7 +41,7 @@ class Chef end def dacl - raise "DACL not present" if !dacl_present? + raise "DACL not present" unless dacl_present? present, acl, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_dacl(self) acl @@ -66,7 +66,7 @@ class Chef end def sacl - raise "SACL not present" if !sacl_present? + raise "SACL not present" unless sacl_present? Security.with_privileges("SeSecurityPrivilege") do present, acl, defaulted = Chef::ReservedNames::Win32::Security.get_security_descriptor_sacl(self) |