Advertisement
Guest User

python sls

a guest
Aug 14th, 2014
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #!py
  2.  
  3. import os
  4.  
  5. def gen_symlink_struct(filename, basepath, targetdir):
  6.   retdir= {
  7.     'file.symlink': [
  8.       {"target" : "%s/%s" % (basepath, filename)},
  9.       {"name" :  "%s/%s" % (targetdir, filename)}
  10.     ]
  11.   }
  12.   return retdir
  13.  
  14. def run():
  15.   retdict={}
  16.   installdir="%s/bin" % pillar['site-mongodb_install_dir']
  17.   for f in os.listdir(installdir):
  18.     retdict["%s_symlink" % f] = gen_symlink_struct(f, installdir, "/usr/bin")
  19.   return retdict
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement