Start on adding file metadata #2707

This commit is contained in:
Thomas S Hatch 2015-12-02 18:26:57 -07:00
parent f5e24872f1
commit 60da6392bc
4 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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