use .get incase attrs are disabled on the filesystem

This commit is contained in:
Daniel Wallace 2017-10-02 11:14:09 -06:00
parent df9317ed39
commit dee0d318c1
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48

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'])