Merge pull request #43864 from gtmanfred/develop

use .get incase attrs are disabled on the filesystem
This commit is contained in:
Nicole Thomas 2017-10-04 11:37:14 -04:00 committed by GitHub
commit 01a0ea8a61

View file

@ -4358,7 +4358,7 @@ def check_perms(name, ret, user, group, mode, attrs=None, follow_symlinks=False)
is_dir = os.path.isdir(name)
if not salt.utils.platform.is_windows() and not is_dir and lsattr_cmd:
# List attributes on file
perms['lattrs'] = ''.join(lsattr(name)[name])
perms['lattrs'] = ''.join(lsattr(name).get('name', ''))
# Remove attributes on file so changes can be enforced.
if perms['lattrs']:
chattr(name, operator='remove', attributes=perms['lattrs'])