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))