Merge pull request #29369 from thatch45/fs_meta

Start on adding file metadata #2707
This commit is contained in:
Mike Place 2015-12-03 10:02:25 -07:00
commit 9dbdcef4da
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): __opts__, full):
fnd['path'] = full fnd['path'] = full
fnd['rel'] = path fnd['rel'] = path
fnd['stat'] = list(os.stat(full))
return fnd return fnd

View File

@ -687,6 +687,7 @@ 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
fnd['stat'] = list(os.stat(dest))
repo['repo'].close() repo['repo'].close()
return fnd return fnd
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): and not salt.fileserver.is_file_ignored(__opts__, full):
fnd['path'] = full fnd['path'] = full
fnd['rel'] = path fnd['rel'] = path
fnd['stat'] = list(os.stat(full))
return fnd return fnd
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): if os.path.isfile(full) and not salt.fileserver.is_file_ignored(__opts__, full):
fnd['path'] = full fnd['path'] = full
fnd['rel'] = path fnd['rel'] = path
fnd['stat'] = list(os.stat(full))
return fnd return fnd
for root in __opts__['file_roots'][saltenv]: for root in __opts__['file_roots'][saltenv]:
full = os.path.join(root, path) full = os.path.join(root, path)
if os.path.isfile(full) and not salt.fileserver.is_file_ignored(__opts__, full): if os.path.isfile(full) and not salt.fileserver.is_file_ignored(__opts__, full):
fnd['path'] = full fnd['path'] = full
fnd['rel'] = path fnd['rel'] = path
fnd['stat'] = list(os.stat(full))
return fnd return fnd
return fnd return fnd