projects
/
mirror
/
dsa-puppet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
010327a
)
Importing psutil sometimes fails, exit gracefully if it happens
author
Tollef Fog Heen
<tfheen@err.no>
Sun, 23 Jun 2013 20:14:18 +0000
(22:14 +0200)
committer
Tollef Fog Heen
<tfheen@err.no>
Sun, 23 Jun 2013 20:14:18 +0000
(22:14 +0200)
modules/buildd/files/buildd-schroot-aptitude-kill
patch
|
blob
|
history
diff --git
a/modules/buildd/files/buildd-schroot-aptitude-kill
b/modules/buildd/files/buildd-schroot-aptitude-kill
index
07f75c1
..
c701a93
100755
(executable)
--- 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