git://git.onelab.eu
/
util-vserver-pl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ecf0a3d
)
Only handle the values that translate.
author
Daniel Hokka Zakrisson
<dhokka@cs.princeton.edu>
Sat, 24 Oct 2009 21:59:43 +0000
(21:59 +0000)
committer
Daniel Hokka Zakrisson
<dhokka@cs.princeton.edu>
Sat, 24 Oct 2009 21:59:43 +0000
(21:59 +0000)
python/vserver.py
patch
|
blob
|
history
diff --git
a/python/vserver.py
b/python/vserver.py
index
081fd8a
..
6e5c709
100644
(file)
--- a/
python/vserver.py
+++ b/
python/vserver.py
@@
-201,9
+201,10
@@
class VServer:
resource_type = RLIMITS[type]
try:
vserverimpl.setrlimit(self.ctx, resource_type, hard, soft, min)
resource_type = RLIMITS[type]
try:
vserverimpl.setrlimit(self.ctx, resource_type, hard, soft, min)
- lim = resource.getrlimit(resource_type)
- lim = adjust_lim((hard, soft, min), lim)
- resource.setrlimit(resource_type, lim)
+ if hasattr(resource, 'RLIMIT_' + type):
+ lim = resource.getrlimit(resource_type)
+ lim = adjust_lim((hard, soft, min), lim)
+ resource.setrlimit(resource_type, lim)
except OSError, e:
self.log("Error: setrlimit(%d, %s, %d, %d, %d): %s"
% (self.ctx, type.lower(), hard, soft, min))
except OSError, e:
self.log("Error: setrlimit(%d, %s, %d, %d, %d): %s"
% (self.ctx, type.lower(), hard, soft, min))