From 4757387f99846bb4329bbdf44ad3341a742fe259 Mon Sep 17 00:00:00 2001 From: Thomas S Hatch Date: Sat, 23 Apr 2011 16:18:56 -0600 Subject: [PATCH] Fix the docs printing sequence --- salt/cli/caller.py | 19 +++++++++---------- salt/loader.py | 2 ++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/salt/cli/caller.py b/salt/cli/caller.py index 8ca123353c..f150948ad9 100644 --- a/salt/cli/caller.py +++ b/salt/cli/caller.py @@ -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 diff --git a/salt/loader.py b/salt/loader.py index 17bb993717..952053cb53 100644 --- a/salt/loader.py +++ b/salt/loader.py @@ -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