mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Add print docs to the salt-call command
This commit is contained in:
parent
edd188ac6b
commit
0df3b8ab8a
@ -29,10 +29,30 @@ class Caller(object):
|
||||
'''
|
||||
return self.loader.call(self.opts['fun'], self.opts['arg'])
|
||||
|
||||
def print_docs(self):
|
||||
'''
|
||||
Pick up the documentation for all of the modules and print it out.
|
||||
'''
|
||||
funcs = loader.minion_mods(self.opts)
|
||||
ret = funcs['sys.doc'](*self.opts['arg'])
|
||||
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]
|
||||
print ''
|
||||
|
||||
def run(self):
|
||||
'''
|
||||
Execute the salt call logic
|
||||
'''
|
||||
if self.opts['doc']:
|
||||
self.print_docs()
|
||||
else:
|
||||
print self.call()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user