Commit 30e20b79 authored by Julien Muchembled's avatar Julien Muchembled

default: fix error handling in pipeCommand()

Traceback (most recent call last):
  ...
  File "slapos/recipe/build/__init__.py", line 191, in pipeCommand
    raise zc.buildout.UserError('Failed while running command:'
  File "slapos/recipe/build/__init__.py", line 192, in <genexpr>
    + ''.join('\n  ' + q for q in failed))
TypeError: cannot concatenate 'str' and 'tuple' objects
parent f42fbfd2
......@@ -178,17 +178,17 @@ class Script(EnvironMixin):
p = subprocess.Popen(command_list, *args, **kwargs)
if previous is not None:
previous.stdout.close()
subprocess_list.append((p, command_list))
run_list.append(' '.join(command_list))
command = ' '.join(command_list)
subprocess_list.append((p, command))
run_list.append(command)
previous = p
self.logger.info('Running: %r' % ' | '.join(run_list))
failed = []
for q in reversed(subprocess_list):
if q[0].wait():
failed.append(q[1])
self.logger.info('Running: %s', ' | '.join(run_list))
failed = [command
for p, command in reversed(subprocess_list)
if p.wait()]
if failed:
raise zc.buildout.UserError('Failed while running command:'
+ ''.join('\n ' + q for q in failed))
raise zc.buildout.UserError('Failed while running:\n '
+ '\n '.join(failed))
def copyTree(self, origin, destination, ignore_dir_list=None):
"""Recursively Copy directory.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment