Created
October 13, 2017 09:52
-
-
Save mumumu/ffb9153b38e4795274bc47d3b85ffab3 to your computer and use it in GitHub Desktop.
[PATCH] output parallel task execution result stats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- fabric/tasks.py 2017-04-24 19:28:00.000000000 -0400 | |
+++ fabric/tasks.py.new 2017-10-13 09:41:45.617000206 -0400 | |
@@ -409,6 +409,22 @@ | |
# This prevents Fabric from continuing on to any other tasks. | |
# Otherwise, pull in results from the child run. | |
ran_jobs = jobs.run() | |
+ print "----" | |
+ from collections import Counter | |
+ c = Counter() | |
+ failed_hosts = [] | |
+ for name, d in ran_jobs.iteritems(): | |
+ if d['exit_code'] == 0: | |
+ c[0] += 1 | |
+ else: | |
+ c[1] += 1 | |
+ failed_hosts.append(name) | |
+ | |
+ print "success: %s, failure: %s" % (c[0], c[1]) | |
+ if failed_hosts: | |
+ print "failed_hosts: \n%s" % ("\n".join(failed_hosts)) | |
+ | |
+ print "----" | |
for name, d in ran_jobs.iteritems(): | |
if d['exit_code'] != 0: | |
if isinstance(d['results'], NetworkError) and \ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment