Fix the docs printing sequence

This commit is contained in:
Thomas S Hatch 2011-04-23 16:18:56 -06:00
parent 29d0356e49
commit 4757387f99
2 changed files with 11 additions and 10 deletions

View File

@ -33,18 +33,17 @@ class Caller(object):
'''
Pick up the documentation for all of the modules and print it out.
'''
ret = self.loader.call('sys.doc', self.opts['arg'])
ret = self.loader.apply_introspection(self.loader.gen_functions())
docs = {}
for host in ret:
for fun in ret[host]:
if not docs.has_key(fun):
if ret[host][fun]:
docs[fun] = ret[host][fun]
for fun in sorted(docs):
print fun + ':'
print docs[fun]
for name in ret:
if not docs.has_key(name):
if ret[name].__doc__:
docs[name] = ret[name].__doc__
for name in sorted(docs):
print name + ':'
print docs[name]
print ''
def run(self):
'''
Execute the salt call logic

View File

@ -103,6 +103,8 @@ class Loader(object):
modules = []
funcs = {}
for mod_dir in self.module_dirs:
if not mod_dir.startswith('/'):
continue
for fn_ in os.listdir(mod_dir):
if fn_.startswith('_'):
continue