Revision ebe6cf38
b/lib/client/gnt_cluster.py | ||
---|---|---|
476 | 476 |
jex.AddJobId(None, status, job_id) |
477 | 477 |
|
478 | 478 |
results = jex.GetResults() |
479 |
bad_cnt = len([row for row in results if not row[0]]) |
|
480 |
if bad_cnt == 0: |
|
479 |
|
|
480 |
(bad_jobs, bad_results) = \ |
|
481 |
map(len, |
|
482 |
# Convert iterators to lists |
|
483 |
map(list, |
|
484 |
# Count errors |
|
485 |
map(compat.partial(itertools.ifilterfalse, bool), |
|
486 |
# Convert result to booleans in a tuple |
|
487 |
zip(*((job_success, len(op_results) == 1 and op_results[0]) |
|
488 |
for (job_success, op_results) in results))))) |
|
489 |
|
|
490 |
if bad_jobs == 0 and bad_results == 0: |
|
481 | 491 |
rcode = constants.EXIT_SUCCESS |
482 | 492 |
else: |
483 |
ToStdout("%s job(s) failed while verifying the cluster.", bad_cnt) |
|
484 | 493 |
rcode = constants.EXIT_FAILURE |
494 |
if bad_jobs > 0: |
|
495 |
ToStdout("%s job(s) failed while verifying the cluster.", bad_jobs) |
|
485 | 496 |
|
486 | 497 |
return rcode |
487 | 498 |
|
Also available in: Unified diff