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): ...@@ -178,17 +178,17 @@ class Script(EnvironMixin):
p = subprocess.Popen(command_list, *args, **kwargs) p = subprocess.Popen(command_list, *args, **kwargs)
if previous is not None: if previous is not None:
previous.stdout.close() previous.stdout.close()
subprocess_list.append((p, command_list)) command = ' '.join(command_list)
run_list.append(' '.join(command_list)) subprocess_list.append((p, command))
run_list.append(command)
previous = p previous = p
self.logger.info('Running: %r' % ' | '.join(run_list)) self.logger.info('Running: %s', ' | '.join(run_list))
failed = [] failed = [command
for q in reversed(subprocess_list): for p, command in reversed(subprocess_list)
if q[0].wait(): if p.wait()]
failed.append(q[1])
if failed: if failed:
raise zc.buildout.UserError('Failed while running command:' raise zc.buildout.UserError('Failed while running:\n '
+ ''.join('\n ' + q for q in failed)) + '\n '.join(failed))
def copyTree(self, origin, destination, ignore_dir_list=None): def copyTree(self, origin, destination, ignore_dir_list=None):
"""Recursively Copy directory. """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