mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Another try on the docs printing, it was not quite right
This commit is contained in:
parent
e4e9690e75
commit
8bff5d075c
2 changed files with 11 additions and 2 deletions
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue