Another try on the docs printing, it was not quite right

This commit is contained in:
Thomas S Hatch 2011-03-14 14:47:05 -06:00
parent e4e9690e75
commit 8bff5d075c
2 changed files with 11 additions and 2 deletions

View file

@ -100,7 +100,7 @@ class SaltCMD(object):
for host in ret:
for fun in ret['host']:
if not docs.has_key(fun):
docs[fun] = ret[host][fun].__doc__
docs[fun] = ret[host][fun]
for fun in docs:
print fun
print docs[fun]

View file

@ -64,10 +64,19 @@ class Minion(object):
if callable(getattr(module, attr)):
functions[mod + '.' + attr] = getattr(module, attr)
functions['sys.list_functions'] = lambda: functions.keys()
functions['sys.doc'] = lambda: functions
functions['sys.doc'] = lambda: self.__get_docs()
print functions
return functions
def __get_docs(self):
'''
Return a dict containing all of the doc strings in the functions dict
'''
docs = {}
for fun in self.functions:
docs[fun] = self.functions[fun].__doc__
return docs
def _handle_payload(self, payload):
'''
Takes a payload from the master publisher and does whatever the