Skip to content

Commit

Permalink
Cookstyle fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed May 15, 2018
1 parent ea3bd96 commit ae0d691
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions libraries/registry_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ def resolve_user_to_sid(username)
end

Chef::Log.debug("Resolved user SID to #{sid}")
return sid
sid
rescue
return nil
nil
end

def hive_loaded?(path)
Expand Down Expand Up @@ -350,7 +350,7 @@ def ensure_hive_unloaded(hive_loaded = false)
end

module Registry
module_function
module_function # rubocop: disable Lint/UselessAccessModifier

extend Windows::RegistryHelper
end
2 changes: 1 addition & 1 deletion libraries/windows_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def expand_env_vars(path)
buf.strip
end

def is_package_installed?(package_name) # rubocop:disable Style/PredicateName
def is_package_installed?(package_name) # rubocop:disable Naming/PredicateName
installed_packages.include?(package_name)
end

Expand Down
2 changes: 1 addition & 1 deletion libraries/windows_privileged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run(*privileges)
unless OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, token)
raise get_last_error
end
token = token.unpack('L')[0]
token = token.unpack1('L')

privileges.each do |name|
unless adjust_privilege(token, name, SE_PRIVILEGE_ENABLED)
Expand Down
1 change: 1 addition & 0 deletions resources/feature_dism.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
property :all, [true, false], default: false
property :timeout, Integer, default: 600

# @return [Array] lowercase the array unless we're on < Windows 2012
def to_lowercase_array(x)
x = x.split(/\s*,\s*/) if x.is_a?(String) # split multiple forms of a comma separated list

Expand Down
2 changes: 1 addition & 1 deletion resources/pagefile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def set_custom_size(pagefile, min, max)
# set a pagefile size to be system managed
#
# @param [String] pagefile path to the pagefile
def set_system_managed(pagefile) # rubocop: disable Style/AccessorMethodName
def set_system_managed(pagefile) # rubocop: disable Naming/AccessorMethodName
converge_by("set #{pagefile} to System Managed") do
Chef::Log.debug("Running #{wmic} pagefileset where SettingID=\"#{get_setting_id(pagefile)}\" set InitialSize=0,MaximumSize=0")
cmd = shell_out("#{wmic} pagefileset where SettingID=\"#{get_setting_id(pagefile)}\" set InitialSize=0,MaximumSize=0", returns: [0])
Expand Down
2 changes: 1 addition & 1 deletion resources/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def load_task_hash(task_name)
if task_hash.respond_to?(:[]) && task_hash[:TaskName] == pathed_task_name
exists true
status :running if task_hash[:Status] == 'Running'
enabled task_hash[:ScheduledTaskState] == 'Enabled' ? true : false
enabled task_hash[:ScheduledTaskState] == 'Enabled'
cwd task_hash[:StartIn] unless task_hash[:StartIn] == 'N/A'
command task_hash[:TaskToRun]
user task_hash[:RunAsUser]
Expand Down

0 comments on commit ae0d691

Please sign in to comment.