Skip to content

Commit

Permalink
Added finished function. Updated join to not consume stdout. Updated …
Browse files Browse the repository at this point in the history
…docs. Updated example
  • Loading branch information
pkittenis committed Aug 25, 2016
1 parent 7b7f6c4 commit f457d80
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 118 deletions.
9 changes: 4 additions & 5 deletions examples/parallel_commands.py
Expand Up @@ -12,11 +12,10 @@
for cmd in cmds:
output.append(client.run_command(cmd, stop_on_errors=False))
end = datetime.datetime.now()
print "Started %s commands on %s host(s) in %s" % (
len(cmds), len(hosts), end-start,)
print("Started %s commands on %s host(s) in %s" % (
len(cmds), len(hosts), end-start,))
start = datetime.datetime.now()
for _output in output:
for line in _output[host]['stdout']:
print line
client.join(_output)
end = datetime.datetime.now()
print "All commands finished in %s" % (end-start,)
print("All commands finished in %s" % (end-start,))

0 comments on commit f457d80

Please sign in to comment.