diff options
Diffstat (limited to 'lib/chef/provider/service')
-rw-r--r-- | lib/chef/provider/service/aixinit.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/service/arch.rb | 4 | ||||
-rw-r--r-- | lib/chef/provider/service/debian.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/service/gentoo.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/service/macosx.rb | 2 | ||||
-rw-r--r-- | lib/chef/provider/service/redhat.rb | 6 | ||||
-rw-r--r-- | lib/chef/provider/service/simple.rb | 4 |
7 files changed, 11 insertions, 11 deletions
diff --git a/lib/chef/provider/service/aixinit.rb b/lib/chef/provider/service/aixinit.rb index 0234673474..73c5e07715 100644 --- a/lib/chef/provider/service/aixinit.rb +++ b/lib/chef/provider/service/aixinit.rb @@ -44,7 +44,7 @@ class Chef else priority_ok = @current_resource.priority == @new_resource.priority end - if @current_resource.enabled and priority_ok + if @current_resource.enabled && priority_ok Chef::Log.debug("#{@new_resource} already enabled - nothing to do") else converge_by("enable service #{@new_resource}") do diff --git a/lib/chef/provider/service/arch.rb b/lib/chef/provider/service/arch.rb index c0545e9fb3..2fd32e37aa 100644 --- a/lib/chef/provider/service/arch.rb +++ b/lib/chef/provider/service/arch.rb @@ -70,7 +70,7 @@ class Chef::Provider::Service::Arch < Chef::Provider::Service::Init new_daemons = [] entries = daemons - if entries.include?(new_resource.service_name) or entries.include?("@#{new_resource.service_name}") + if entries.include?(new_resource.service_name) || entries.include?("@#{new_resource.service_name}") # exists and already enabled (or already enabled as a background service) # new_daemons += entries else @@ -100,7 +100,7 @@ class Chef::Provider::Service::Arch < Chef::Provider::Service::Init # exists and disabled # new_daemons += entries else - if entries.include?(new_resource.service_name) or entries.include?("@#{new_resource.service_name}") + if entries.include?(new_resource.service_name) || entries.include?("@#{new_resource.service_name}") # exists but enabled (or enabled as a back-ground service) # FIXME: Does arch support !@foobar ? entries.each do |daemon| diff --git a/lib/chef/provider/service/debian.rb b/lib/chef/provider/service/debian.rb index 6550c85b2a..67b71953f7 100644 --- a/lib/chef/provider/service/debian.rb +++ b/lib/chef/provider/service/debian.rb @@ -124,7 +124,7 @@ class Chef else priority_ok = @current_resource.priority == new_resource.priority end - if current_resource.enabled and priority_ok + if current_resource.enabled && priority_ok Chef::Log.debug("#{new_resource} already enabled - nothing to do") else converge_by("enable service #{new_resource}") do diff --git a/lib/chef/provider/service/gentoo.rb b/lib/chef/provider/service/gentoo.rb index 56064bc03a..8fb6d1f9af 100644 --- a/lib/chef/provider/service/gentoo.rb +++ b/lib/chef/provider/service/gentoo.rb @@ -38,7 +38,7 @@ class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init exists = ::File.exists? file readable = ::File.readable? file Chef::Log.debug "#{@new_resource} exists: #{exists}, readable: #{readable}" - exists and readable + exists && readable end ) Chef::Log.debug "#{@new_resource} enabled: #{@current_resource.enabled}" diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb index e6e57e4695..648cd9748b 100644 --- a/lib/chef/provider/service/macosx.rb +++ b/lib/chef/provider/service/macosx.rb @@ -181,7 +181,7 @@ class Chef end def set_service_status - return if @plist == nil or @service_label.to_s.empty? + return if @plist == nil || @service_label.to_s.empty? cmd = "launchctl list #{@service_label}" res = shell_out_as_user(cmd) diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb index a76622ee8f..08f8e108d5 100644 --- a/lib/chef/provider/service/redhat.rb +++ b/lib/chef/provider/service/redhat.rb @@ -76,7 +76,7 @@ class Chef if ::File.exists?("/sbin/chkconfig") chkconfig = shell_out!("/sbin/chkconfig --list #{current_resource.service_name}", :returns => [0, 1]) - unless run_levels.nil? or run_levels.empty? + unless run_levels.nil? || run_levels.empty? all_levels_match = true chkconfig.stdout.split(/\s+/)[1..-1].each do |level| index = level.split(":").first @@ -100,11 +100,11 @@ class Chef # @api private def levels - (run_levels.nil? or run_levels.empty?) ? "" : "--level #{run_levels.join('')} " + (run_levels.nil? || run_levels.empty?) ? "" : "--level #{run_levels.join('')} " end def enable_service() - unless run_levels.nil? or run_levels.empty? + unless run_levels.nil? || run_levels.empty? disable_levels = current_run_levels - run_levels shell_out! "/sbin/chkconfig --level #{disable_levels.join('')} #{new_resource.service_name} off" unless disable_levels.empty? end diff --git a/lib/chef/provider/service/simple.rb b/lib/chef/provider/service/simple.rb index d76779a74b..fe4768b2e8 100644 --- a/lib/chef/provider/service/simple.rb +++ b/lib/chef/provider/service/simple.rb @@ -76,8 +76,8 @@ class Chef end requirements.assert(:all_actions) do |a| - a.assertion { @new_resource.status_command or supports[:status] or - (!ps_cmd.nil? and !ps_cmd.empty?) } + a.assertion { @new_resource.status_command || supports[:status] || + (!ps_cmd.nil? && !ps_cmd.empty?) } a.failure_message Chef::Exceptions::Service, "#{@new_resource} could not determine how to inspect the process table, please set this node's 'command.ps' attribute" end requirements.assert(:all_actions) do |a| |