summaryrefslogtreecommitdiff
path: root/lib/chef/file_access_control
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-05-15 13:47:47 -0700
committersersut <serdar@opscode.com>2013-05-15 13:47:47 -0700
commitbd800b2e2d34e4af1e9eba8b91ba5ad64d06c324 (patch)
tree9fa4b14aeff9239348897ee46ec300a0ecf78423 /lib/chef/file_access_control
parenteef83d8ab5943af1dd3b25ccc94ef71d772d945a (diff)
downloadchef-bd800b2e2d34e4af1e9eba8b91ba5ad64d06c324.tar.gz
Fix nitpick comments and code typos.
Diffstat (limited to 'lib/chef/file_access_control')
-rw-r--r--lib/chef/file_access_control/unix.rb39
1 files changed, 18 insertions, 21 deletions
diff --git a/lib/chef/file_access_control/unix.rb b/lib/chef/file_access_control/unix.rb
index d54fe6ad63..db161e24e4 100644
--- a/lib/chef/file_access_control/unix.rb
+++ b/lib/chef/file_access_control/unix.rb
@@ -69,20 +69,19 @@ class Chef
# the user has not specified a permission on the new resource, so we never manage it with FAC
Chef::Log.debug("found target_uid == nil, so no owner was specified on resource, not managing owner")
return false
- end
- if current_uid.nil?
+ elsif current_uid.nil?
# the user has specified a permission, and we are creating a file, so always enforce permissions
Chef::Log.debug("found current_uid == nil, so we are creating a new file, updating owner")
return true
- end
- if target_uid != current_uid
+ elsif target_uid != current_uid
# the user has specified a permission, and it does not match the file, so fix the permission
Chef::Log.debug("found target_uid != current_uid, updating owner")
return true
+ else
+ Chef::Log.debug("found target_uid == current_uid, not updating owner")
+ # the user has specified a permission, but it matches the file, so behave idempotently
+ return false
end
- Chef::Log.debug("found target_uid == current_uid, not updating owner")
- # the user has specified a permission, but it matches the file, so behave idempotently
- return false
end
def set_owner!
@@ -129,20 +128,19 @@ class Chef
# the user has not specified a permission on the new resource, so we never manage it with FAC
Chef::Log.debug("found target_gid == nil, so no group was specified on resource, not managing group")
return false
- end
- if current_gid.nil?
+ elsif current_gid.nil?
# the user has specified a permission, and we are creating a file, so always enforce permissions
Chef::Log.debug("found current_gid == nil, so we are creating a new file, updating group")
return true
- end
- if target_gid != current_gid
+ elsif target_gid != current_gid
# the user has specified a permission, and it does not match the file, so fix the permission
Chef::Log.debug("found target_gid != current_gid, updating group")
return true
+ else
+ Chef::Log.debug("found target_gid == current_gid, not updating group")
+ # the user has specified a permission, but it matches the file, so behave idempotently
+ return false
end
- Chef::Log.debug("found target_gid == current_gid, not updating group")
- # the user has specified a permission, but it matches the file, so behave idempotently
- return false
end
def set_group!
@@ -179,20 +177,19 @@ class Chef
# the user has not specified a permission on the new resource, so we never manage it with FAC
Chef::Log.debug("found target_mode == nil, so no mode was specified on resource, not managing mode")
return false
- end
- if current_mode.nil?
+ elsif current_mode.nil?
# the user has specified a permission, and we are creating a file, so always enforce permissions
Chef::Log.debug("found current_mode == nil, so we are creating a new file, updating mode")
return true
- end
- if target_mode != current_mode
+ elsif target_mode != current_mode
# the user has specified a permission, and it does not match the file, so fix the permission
Chef::Log.debug("found target_mode != current_mode, updating mode")
return true
+ else
+ Chef::Log.debug("found target_mode == current_mode, not updating mode")
+ # the user has specified a permission, but it matches the file, so behave idempotently
+ return false
end
- Chef::Log.debug("found target_mode == current_mode, not updating mode")
- # the user has specified a permission, but it matches the file, so behave idempotently
- return false
end
def set_mode!