Skip to content

Commit

Permalink
fix bw run with dummy nodes
Browse files Browse the repository at this point in the history
closes #373
  • Loading branch information
trehn committed Sep 28, 2017
1 parent c4a973e commit 79cdc9d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions bundlewrap/cmdline/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ def stats_summary(results, include_stdout, include_stderr):

for node_name, result in sorted(results.items()):
row = [node_name]
if result.return_code == 0:
if result is None:
# node has been skipped
continue
elif result.return_code == 0:
row.append(green(str(result.return_code)))
else:
row.append(red(str(result.return_code)))
Expand All @@ -89,8 +92,9 @@ def stats_summary(results, include_stdout, include_stderr):
if include_stdout or include_stderr:
# remove last ROW_SEPARATOR
rows = rows[:-1]
for line in render_table(rows, alignments={1: 'right', 2: 'right'}):
io.stdout("{x} {line}".format(x=blue("i"), line=line))
if len(rows) > 2: # table might be empty if all nodes have been skipped
for line in render_table(rows, alignments={1: 'right', 2: 'right'}):
io.stdout("{x} {line}".format(x=blue("i"), line=line))


def bw_run(repo, args):
Expand Down Expand Up @@ -127,7 +131,7 @@ def next_task():
def handle_result(task_id, return_value, duration):
io.progress_advance()
results[task_id] = return_value
if return_value == 0:
if return_value is None or return_value.return_code == 0:
skip_list.add(task_id)

def handle_exception(task_id, exception, traceback):
Expand Down

0 comments on commit 79cdc9d

Please sign in to comment.