don't blow up check_perms if lsattr file doesn't exist

This commit is contained in:
Daniel Wallace 2018-08-20 09:13:36 -05:00
parent aaa9e37215
commit ab918ca6b0
No known key found for this signature in database
GPG key ID: 5FA5E5544F010D48

View file

@ -4459,7 +4459,10 @@ def check_perms(name, ret, user, group, mode, attrs=None, follow_symlinks=False)
is_dir = os.path.isdir(name)
is_link = os.path.islink(name)
if not salt.utils.platform.is_windows() and not is_dir and not is_link:
lattrs = lsattr(name)
try:
lattrs = lsattr(name)
except SaltInvocationError:
lsattrs = None
if lattrs is not None:
# List attributes on file
perms['lattrs'] = ''.join(lattrs.get(name, ''))