mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
salt/fileserver/hgfs.py: add try/except to file stat
This commit is contained in:
parent
5983d990df
commit
150f35e2c8
@ -687,7 +687,22 @@ def find_file(path, tgt_env='base', **kwargs): # pylint: disable=W0613
|
|||||||
pass
|
pass
|
||||||
fnd['rel'] = path
|
fnd['rel'] = path
|
||||||
fnd['path'] = dest
|
fnd['path'] = dest
|
||||||
|
try:
|
||||||
|
# Converting the stat result to a list, the elements of the
|
||||||
|
# list correspond to the following stat_result params:
|
||||||
|
# 0 => st_mode=33188
|
||||||
|
# 1 => st_ino=10227377
|
||||||
|
# 2 => st_dev=65026
|
||||||
|
# 3 => st_nlink=1
|
||||||
|
# 4 => st_uid=1000
|
||||||
|
# 5 => st_gid=1000
|
||||||
|
# 6 => st_size=1056233
|
||||||
|
# 7 => st_atime=1468284229
|
||||||
|
# 8 => st_mtime=1456338235
|
||||||
|
# 9 => st_ctime=1456338235
|
||||||
fnd['stat'] = list(os.stat(dest))
|
fnd['stat'] = list(os.stat(dest))
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
repo['repo'].close()
|
repo['repo'].close()
|
||||||
return fnd
|
return fnd
|
||||||
return fnd
|
return fnd
|
||||||
|
Loading…
Reference in New Issue
Block a user