merge rev17211 (Need to print the exception string as part of the self.log, or else...
[util-vserver-pl.git] / python / vserver.py
index 59141aa..55d78f0 100644 (file)
@@ -185,7 +185,7 @@ class VServer:
                 vserverimpl.setrlimit(self.ctx, resource_type, hard, soft, min)
             except OSError, e:
                 self.log("Error: setrlimit(%d, %s, %d, %d, %d): %s"
-                         % (self.ctx, type.lower(), hard, soft, min))
+                         % (self.ctx, type.lower(), hard, soft, min, e))
 
         return update
 
@@ -380,12 +380,8 @@ class VServer:
         else:
             # child process
             try:
-                f = "/etc/vservers/%s/spaces/net" % self.name
-                # Always start vserver with a network namespace.  
-                subprocess.call(["/bin/touch", f], shell=False)
                 subprocess.call("/usr/sbin/vserver %s start" % self.name, 
                                 shell=True)
-                #subprocess.call(["/bin/rm", f], shell=False)
             # we get here due to an exception in the top-level child process
             except Exception, ex:
                 self.log(traceback.format_exc())
@@ -431,6 +427,10 @@ class VServer:
     def setname(self, slice_id):
         pass
 
+    def getname(self):
+        '''Get vcVHI_CONTEXT field in kernel'''
+        return vserverimpl.getname(self.ctx)
+
 
 def create(vm_name, static = False, ctor = VServer):