From 70864a6d7152c850f67d519212a2305a32648681 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Sun, 23 Jun 2013 22:14:18 +0200 Subject: [PATCH] Importing psutil sometimes fails, exit gracefully if it happens --- modules/buildd/files/buildd-schroot-aptitude-kill | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/buildd/files/buildd-schroot-aptitude-kill b/modules/buildd/files/buildd-schroot-aptitude-kill index 07f75c1de..c701a93df 100755 --- a/modules/buildd/files/buildd-schroot-aptitude-kill +++ b/modules/buildd/files/buildd-schroot-aptitude-kill @@ -24,7 +24,14 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import os -import psutil +import errno +try: + import psutil +except OSError, e: + # XXX: This is a hack, but since we are run from cron, it's + # better to handle this on the next run than to send mail. + if e.errno == errno.ENOENT: + sys.exit(0) total_mem = psutil.phymem_usage().total cutoff_time = 60*10 -- 2.20.1