diff options
Diffstat (limited to 'slave/cleanup_on_death.py')
-rwxr-xr-x | slave/cleanup_on_death.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/slave/cleanup_on_death.py b/slave/cleanup_on_death.py deleted file mode 100755 index 00c37ea..0000000 --- a/slave/cleanup_on_death.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -# vim: set sw=4 sts=4 et : -# Copyright: 2008 Gentoo Foundation -# Author(s): Nirbheek Chauhan <nirbheek.chauhan@gmail.com> -# License: GPL-2 -# -# 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.TMPDIR.replace(' ', r'\\040')) - for mount in regex.findall(mounts): - mount = mount.replace(r'\040(deleted)', '').replace(r'\040', ' ') - subprocess.check_call('umount "%s"' % mount, shell=True) - -print "ZOMG!@~: WE DIED. Cleaning up stuff..." -clean_mounts() |