Advertisement
Guest User

Untitled

a guest
Apr 14th, 2015
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. def minion_metadata():
  4.     minion_id = open("/etc/salt/minion_id","r").read().replace('\n', '')    
  5.    
  6.     try:
  7.         env, role, idx = minion_id.split('.')
  8.     except Exception:
  9.         return {}
  10.    
  11.     return {
  12.         'env': env,
  13.         'role': role,
  14.         'idx': idx
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement