Advertisement
huntermatthews

Untitled

Feb 25th, 2014
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. #! /usr/bin/python
  2.  
  3. from yaml import load
  4. from pprint import pprint
  5. from os.path import exists
  6. from os import remove
  7.  
  8. # /var/cache/salt/master/minions/CLIENT/data.p
  9.  
  10. with open('/etc/salt/roster', 'r') as f:
  11.     roster = load(f)
  12.     for key in roster.keys():
  13.         path = '/var/cache/salt/master/minions/%s/data.p' % key
  14.         if exists(path):
  15.             remove(path)
  16.         else:
  17.             print '%s does not have a data.p file in %s' % (key, path)
  18.  
  19.  
  20. ## END OF LINE ##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement