add vserver name as the last command argument
[util-vserver-pl.git] / python / vserver.py
index c05adb6..fea10c3 100644 (file)
@@ -278,7 +278,7 @@ class VServer:
         os.chroot(self.dir)
         os.chdir("/")
 
-    def chroot_call(self, fn, *args, **kwargs={}):
+    def chroot_call(self, fn, *args, **kwargs):
 
         cwd_fd = os.open(".", os.O_RDONLY)
         try:
@@ -466,6 +466,8 @@ class VServer:
                         # enter vserver context
                         arg_subst = { 'runlevel': runlevel }
                         cmd_args = [cmd[0]] + map(lambda x: x % arg_subst, cmd[1:])
+                        # add vserver name as the last command argument
+                        cmd_args += [self.name]
                         cmd_file = "/vservers/" + self.name + cmd[0]
                         self.log(cmd_file)
                         if os.path.isfile(cmd_file):