summaryrefslogtreecommitdiff
path: root/lib/chef/daemon.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-03-14 10:34:33 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-03-14 10:34:33 -0700
commit6705acbd7f301d1b04388043a3dfa0308655f120 (patch)
tree1e8a43b35ef1684a4b90578f1a6374758aa7e3c7 /lib/chef/daemon.rb
parent365064280c93d519fdacbf032c0c21057e5549c9 (diff)
downloadchef-6705acbd7f301d1b04388043a3dfa0308655f120.tar.gz
chefstyle Style/AndOr fixes
this is part of our informal style guide, lets make it formal since clearly its not getting followed very well.
Diffstat (limited to 'lib/chef/daemon.rb')
-rw-r--r--lib/chef/daemon.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/daemon.rb b/lib/chef/daemon.rb
index 242419890c..70bdddf457 100644
--- a/lib/chef/daemon.rb
+++ b/lib/chef/daemon.rb
@@ -61,7 +61,7 @@ class Chef
# String::
# Location of the pid file for @name
def pid_file
- Chef::Config[:pid_file] or "/tmp/#{@name}.pid"
+ Chef::Config[:pid_file] || "/tmp/#{@name}.pid"
end
# Suck the pid out of pid_file
@@ -82,7 +82,7 @@ class Chef
def change_privilege
Dir.chdir("/")
- if Chef::Config[:user] and Chef::Config[:group]
+ if Chef::Config[:user] && Chef::Config[:group]
Chef::Log.info("About to change privilege to #{Chef::Config[:user]}:#{Chef::Config[:group]}")
_change_privilege(Chef::Config[:user], Chef::Config[:group])
elsif Chef::Config[:user]
@@ -117,7 +117,7 @@ class Chef
return false
end
- if (uid != target_uid) or (gid != target_gid)
+ if (uid != target_uid) || (gid != target_gid)
Process.initgroups(user, target_gid)
Process::GID.change_privilege(target_gid)
Process::UID.change_privilege(target_uid)