Skip to content

Commit

Permalink
Fix foodcritic offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
legal90 committed Jan 18, 2017
1 parent df8d1ce commit 9669a92
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .foodcritic
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
-t ~FC001 -t ~FC054
~FC019
~FC044
4 changes: 2 additions & 2 deletions libraries/consul_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def tls?
[::File.dirname(new_resource.path), new_resource.config_dir].each do |dir|
directory dir do
recursive true
unless node.platform?('windows')
unless platform?('windows')
owner new_resource.owner
group new_resource.group
mode '0755'
Expand All @@ -205,7 +205,7 @@ def tls?
end

file new_resource.path do
unless node.platform?('windows')
unless platform?('windows')
owner new_resource.owner
group new_resource.group
mode '0640'
Expand Down
4 changes: 2 additions & 2 deletions libraries/consul_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def to_json
notifying_block do
directory ::File.dirname(new_resource.path) do
recursive true
unless node.platform?('windows')
unless platform?('windows')
owner new_resource.user
group new_resource.group
mode '0755'
Expand All @@ -57,7 +57,7 @@ def to_json

file new_resource.path do
content new_resource.to_json
unless node.platform?('windows')
unless platform?('windows')
owner new_resource.user
group new_resource.group
mode '0640'
Expand Down
2 changes: 1 addition & 1 deletion libraries/consul_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def service_options(service)
service.options(:sysvinit, template: 'consul:sysvinit.service.erb')
service.options(:upstart, template: 'consul:upstart.service.erb', executable: new_resource.program)

if node.platform_family?('rhel') && node.platform_version.to_i == 6
if platform_family?('rhel') && node['platform_version'].to_i == 6
service.provider(:sysvinit)
end
end
Expand Down
7 changes: 3 additions & 4 deletions libraries/consul_service_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,9 @@ def action_enable
end
# Check if the service is running, but don't bother if we're already
# changing some nssm parameters
unless nssm_service_status?(%w(SERVICE_RUNNING)) && mismatch_params.empty?
powershell_script 'Trigger consul restart' do
code 'restart-service consul'
end
powershell_script 'Trigger consul restart' do
code 'restart-service consul'
not_if { nssm_service_status?(%w(SERVICE_RUNNING)) && mismatch_params.empty? }
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions libraries/consul_watch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def to_json
notifying_block do
directory ::File.dirname(new_resource.path) do
recursive true
unless node.platform?('windows')
unless platform?('windows')
owner new_resource.user
group new_resource.group
mode '0755'
Expand All @@ -52,7 +52,7 @@ def to_json

file new_resource.path do
content new_resource.to_json
unless node.platform?('windows')
unless platform?('windows')
owner new_resource.user
group new_resource.group
mode '0640'
Expand Down

0 comments on commit 9669a92

Please sign in to comment.