Merge pull request #49209 from gtmanfred/lsattr

don't blow up check_perms if lsattr file doesn't exist
This commit is contained in:
Daniel Wallace 2018-08-20 14:02:42 -05:00 committed by GitHub
commit a4c51a9e18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4464,7 +4464,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, ''))