aboutsummaryrefslogtreecommitdiff
path: root/slave
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-05 11:01:48 +0530
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2008-08-05 11:01:48 +0530
commit9a6ec7a1d2b4469f92a9e04f158a04a7c1bd402c (patch)
treeb6972e87f80486bfeb1456b574de86b9952fa6c1 /slave
parentDefine a default module ('job') for which_tests.py . Document it too. (diff)
downloadautotua-9a6ec7a1d2b4469f92a9e04f158a04a7c1bd402c.tar.gz
autotua-9a6ec7a1d2b4469f92a9e04f158a04a7c1bd402c.tar.bz2
autotua-9a6ec7a1d2b4469f92a9e04f158a04a7c1bd402c.zip
* Fix unmounting when we die prematurely
Diffstat (limited to 'slave')
-rw-r--r--slave/autotua/chroot/__init__.py2
-rwxr-xr-xslave/cleanup_on_death.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/slave/autotua/chroot/__init__.py b/slave/autotua/chroot/__init__.py
index 167f643..08ec7df 100644
--- a/slave/autotua/chroot/__init__.py
+++ b/slave/autotua/chroot/__init__.py
@@ -93,7 +93,7 @@ class WorkChroot(object):
def _clean_mounts(self):
# /proc/mounts is more reliable than mtab (which is what `mount` uses)
mounts = open('/proc/mounts', 'r').read()
- regex = re.compile(r'%s/[^ ]+' % self.chrootdir.replace(' ', r'\\040'))
+ regex = re.compile(r'%s/[^ ]+' % self.chrootdir.replace(' ', r'\040'))
for mount in regex.findall(mounts):
subprocess.check_call('umount "%s"' % mount.replace(r'\040', ' '), shell=True)
diff --git a/slave/cleanup_on_death.py b/slave/cleanup_on_death.py
index feef5b1..e8f6e42 100755
--- a/slave/cleanup_on_death.py
+++ b/slave/cleanup_on_death.py
@@ -7,14 +7,15 @@
# Immortal lh!
#
+import re, subprocess
from autotua import const
def clean_mounts():
# /proc/mounts is more reliable than mtab (which is what `mount` uses)
mounts = open('/proc/mounts', 'r').read()
- regex = re.compile(r'%s/[^ ]+' % const.AUTOTUA_DIR.replace(' ', r'\\040'))
+ regex = re.compile(r'%s/[^ ]+' % const.TMPDIR.replace(' ', r'\040'))
for mount in regex.findall(mounts):
subprocess.check_call('umount "%s"' % mount.replace(r'\040', ' '), shell=True)
print "ZOMG!@~: WE DIED. Cleaning up stuff..."
-clean_mounts
+clean_mounts()