diff options
author | adamedx <adamedx@gmail.com> | 2016-02-15 07:48:47 -0800 |
---|---|---|
committer | nimisha <nimisha.sharad@msystechnologies.com> | 2017-02-02 18:00:30 +0530 |
commit | aa155445b92e87baf1895ce092da3ae4c93117e6 (patch) | |
tree | cbb3f01bafeb456866e63674231f64386dc86f41 /lib/chef/provider/script.rb | |
parent | f0809fbb1c08ad14faed9c51f861a94373a39d27 (diff) | |
download | chef-aa155445b92e87baf1895ce092da3ae4c93117e6.tar.gz |
Rubocop violations in execute resource alternate user implementation
Diffstat (limited to 'lib/chef/provider/script.rb')
-rw-r--r-- | lib/chef/provider/script.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/chef/provider/script.rb b/lib/chef/provider/script.rb index 9aee6fe442..3f89672f21 100644 --- a/lib/chef/provider/script.rb +++ b/lib/chef/provider/script.rb @@ -16,10 +16,10 @@ # limitations under the License. # -require 'tempfile' -require 'chef/provider/execute' -require 'chef/win32/security' if Chef::Platform.windows? -require 'forwardable' +require "tempfile" +require "chef/provider/execute" +require "chef/win32/security" if Chef::Platform.windows? +require "forwardable" class Chef class Provider @@ -83,7 +83,7 @@ class Chef # Duplicate the script file's existing DACL # so we can add an ACE later securable_object = Chef::ReservedNames::Win32::Security::SecurableObject.new(script_file.path) - aces = securable_object.security_descriptor.dacl.reduce([]) { | result, current | result.push(current) } + aces = securable_object.security_descriptor.dacl.reduce([]) { |result, current| result.push(current) } username = new_resource.user @@ -99,7 +99,9 @@ class Chef acl = Chef::ReservedNames::Win32::Security::ACL.create(aces) # This actually applies the modified DACL to the file - securable_object.dacl = acl + # Use parentheses to bypass RuboCop / ChefStyle warning + # about useless setter + (securable_object.dacl = acl) end def script_file |