Skip to content

Instantly share code, notes, and snippets.

@mprymek
Created January 5, 2015 20:18
Show Gist options
  • Save mprymek/089409060b44c5d0ff49 to your computer and use it in GitHub Desktop.
Save mprymek/089409060b44c5d0ff49 to your computer and use it in GitHub Desktop.
#! py
import os.path
def run():
files = {}
pillar_root = __opts__['pillar_roots'][__env__][0]
priv_root = '%s/_priv/%s'%(pillar_root,__opts__['id'])
for dirname, dirnames, fnames in os.walk(priv_root):
for fname in fnames:
files[fname] = open(os.path.join(priv_root,fname)).read()
return {
'files': files,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment