mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Start on adding file metadata #2707
This commit is contained in:
parent
f5e24872f1
commit
60da6392bc
@ -97,6 +97,7 @@ def find_file(path, saltenv='base', env=None, **kwargs):
|
||||
__opts__, full):
|
||||
fnd['path'] = full
|
||||
fnd['rel'] = path
|
||||
fnd['stat'] = list(os.stat(full))
|
||||
return fnd
|
||||
|
||||
|
||||
|
@ -687,6 +687,7 @@ def find_file(path, tgt_env='base', **kwargs): # pylint: disable=W0613
|
||||
pass
|
||||
fnd['rel'] = path
|
||||
fnd['path'] = dest
|
||||
fnd['stat'] = list(os.stat(dest))
|
||||
repo['repo'].close()
|
||||
return fnd
|
||||
return fnd
|
||||
|
@ -91,6 +91,7 @@ def find_file(path, tgt_env='base', **kwargs): # pylint: disable=W0613
|
||||
and not salt.fileserver.is_file_ignored(__opts__, full):
|
||||
fnd['path'] = full
|
||||
fnd['rel'] = path
|
||||
fnd['stat'] = list(os.stat(full))
|
||||
return fnd
|
||||
return fnd
|
||||
|
||||
|
@ -64,12 +64,14 @@ def find_file(path, saltenv='base', env=None, **kwargs):
|
||||
if os.path.isfile(full) and not salt.fileserver.is_file_ignored(__opts__, full):
|
||||
fnd['path'] = full
|
||||
fnd['rel'] = path
|
||||
fnd['stat'] = list(os.stat(full))
|
||||
return fnd
|
||||
for root in __opts__['file_roots'][saltenv]:
|
||||
full = os.path.join(root, path)
|
||||
if os.path.isfile(full) and not salt.fileserver.is_file_ignored(__opts__, full):
|
||||
fnd['path'] = full
|
||||
fnd['rel'] = path
|
||||
fnd['stat'] = list(os.stat(full))
|
||||
return fnd
|
||||
return fnd
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user