@@ -410,12 +410,15 @@ def run_command(self, *args, **kwargs):
410410 :type kwargs: dict
411411
412412 :rtype: Dictionary with host as key as per :mod:`ParallelSSH.get_output`:
413- ``{'myhost1': {'exit_code': exit code if ready else None,
413+
414+ ::
415+
416+ {'myhost1': {'exit_code': exit code if ready else None,
414417 'channel' : SSH channel of command,
415418 'stdout' : <iterable>,
416419 'stderr' : <iterable>,
417- 'cmd' : <greenlet>}}``
418-
420+ 'cmd' : <greenlet>}}
421+
419422 **Example**:
420423
421424 >>> output = client.run_command('ls -ltrh')
@@ -438,9 +441,11 @@ def run_command(self, *args, **kwargs):
438441 Capture stdout - **WARNING** - this will store the entirety of stdout
439442 into memory and may exhaust available memory if command output is
440443 large enough:
444+
441445 >>> for host in output:
442446 >>> stdout = list(output[host]['stdout'])
443447 >>> print "Complete stdout for host %s is %s" % (host, stdout,)
448+
444449 """
445450 for host in self .hosts :
446451 self .pool .spawn (self ._exec_command , host , * args , ** kwargs )
@@ -514,11 +519,16 @@ def get_output(self, commands=None):
514519 Uses running commands in pool if not given
515520 :type commands: :mod:`gevent.Greenlet`
516521 :rtype: Dictionary with host as key as in:
517- ``{'myhost1': {'exit_code': exit code if ready else None,
522+
523+ ::
524+
525+ {'myhost1': {'exit_code': exit code if ready else None,
518526 'channel' : SSH channel of command,
519527 'stdout' : <iterable>,
520528 'stderr' : <iterable>,
521- 'cmd' : <greenlet>}}``"""
529+ 'cmd' : <greenlet>}}
530+
531+ """
522532 if not commands :
523533 commands = list (self .pool .greenlets )
524534 return {host : {'exit_code' : self ._get_exit_code (channel ),
0 commit comments