Skip to content

Commit f457d80

Browse files
author
Dan
committed
Added finished function. Updated join to not consume stdout. Updated docs. Updated example
1 parent 7b7f6c4 commit f457d80

File tree

4 files changed

+207
-118
lines changed

4 files changed

+207
-118
lines changed

examples/parallel_commands.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
for cmd in cmds:
1313
output.append(client.run_command(cmd, stop_on_errors=False))
1414
end = datetime.datetime.now()
15-
print "Started %s commands on %s host(s) in %s" % (
16-
len(cmds), len(hosts), end-start,)
15+
print("Started %s commands on %s host(s) in %s" % (
16+
len(cmds), len(hosts), end-start,))
1717
start = datetime.datetime.now()
1818
for _output in output:
19-
for line in _output[host]['stdout']:
20-
print line
19+
client.join(_output)
2120
end = datetime.datetime.now()
22-
print "All commands finished in %s" % (end-start,)
21+
print("All commands finished in %s" % (end-start,))

0 commit comments

Comments
 (0)