Permalink
Browse files

Add ps grain and some comments about how the grains interface needs some

serious love
  • Loading branch information...
1 parent cc42b7d commit ef75dfe6c27a833c7822e86ee5286abf47277d3c @thatch45 thatch45 committed May 16, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 salt/grains/core.py
View
13 salt/grains/core.py
@@ -8,6 +8,8 @@
module can be overwritten just by returning dict keys with the same value
as those returned here
'''
+# This needs some refactoring, I made it "as fast as I could" and could be a
+# lot clearer, so far it is spaghetti code
# Import python modules
import os
import subprocess
@@ -55,9 +57,18 @@ def _virtual(os_data):
grains['virtual'] = 'kvm'
return grains
+def _ps(os_data):
+ '''
+ Return the ps grain
+ '''
+ grains = {}
+ grains['ps'] = 'ps auxwww' if\
+ 'FreeBSD NetBSD OpenBSD Darwin'.count(os_data['os']) else 'ps -ef'
+ return grains
+
def os_data():
'''
- Return grins pertaining to the operating system
+ Return grains pertaining to the operating system
'''
grains = {}
grains.update(_kernel())

0 comments on commit ef75dfe

Please sign in to comment.