Commit a5378e7e authored by Antoine Catton's avatar Antoine Catton

Making the tests pass

parent 2e925da6
...@@ -477,12 +477,13 @@ class Slapgrid(object): ...@@ -477,12 +477,13 @@ class Slapgrid(object):
# Get the list of promises # Get the list of promises
promise_dir = os.path.join(instance_path, 'etc', 'promise') promise_dir = os.path.join(instance_path, 'etc', 'promise')
if os.path.exists(promise_dir) and os.path.isdir(promise_dir): if os.path.exists(promise_dir) and os.path.isdir(promise_dir):
commands_to_run = os.listdir(promise_dir) commands_to_run = [os.path.join(promise_dir, command)
for command in os.listdir(promise_dir)]
cwd = instance_path cwd = instance_path
# Check whether every promise is kept # Check whether every promise is kept
for process_handler, command in \ for process_handler, command in \
self._runCommandAsUserAndYieldPopen(commands_to_run, self._runCommandsAsUserAndYieldPopen(commands_to_run,
(uid, gid), cwd): (uid, gid), cwd):
time.sleep(self.promise_timeout) time.sleep(self.promise_timeout)
...@@ -492,7 +493,7 @@ class Slapgrid(object): ...@@ -492,7 +493,7 @@ class Slapgrid(object):
if process_handler.poll() is None: if process_handler.poll() is None:
process_handler.kill() process_handler.kill()
computer_partition.error("The promise %r timed out" % promise) computer_partition.error("The promise %r timed out" % promise)
elif process_handler.returncode != 0: elif process_handler.poll() != 0:
stderr = process_handler.communicate()[1] stderr = process_handler.communicate()[1]
if stderr is None: if stderr is None:
stderr = 'No error output from %r.' % promise stderr = 'No error output from %r.' % promise
...@@ -582,7 +583,7 @@ class Slapgrid(object): ...@@ -582,7 +583,7 @@ class Slapgrid(object):
cwd = os.path.join(instance_path, 'etc', 'report') cwd = os.path.join(instance_path, 'etc', 'report')
for process_handler, command in \ for process_handler, command in \
self._runCommandAsUserAndYieldPopen(commands_to_run, self._runCommandsAsUserAndYieldPopen(commands_to_run,
(uid, gid), cwd): (uid, gid), cwd):
result = process_handler.communicate()[0] result = process_handler.communicate()[0]
......
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