Merge branch 'lxc_devel' of ssh://git.planet-lab.org/git/nodemanager into lxc_devel
[nodemanager.git] / sliver_vs.py
index 0b15e25..2febb37 100644 (file)
@@ -67,7 +67,6 @@ class Sliver_VS(accounts.Account, vserver.VServer):
             self.create(name, rec)
             logger.log("sliver_vs: %s: second chance..."%name)
             vserver.VServer.__init__(self, name,logfile='/var/log/nodemanager')
-
         self.keys = ''
         self.rspec = {}
         self.slice_id = rec['slice_id']
@@ -110,11 +109,18 @@ class Sliver_VS(accounts.Account, vserver.VServer):
                 personality="linux64"
             return personality
 
-        extra = ""
+        command=[]
+        # be verbose
+        command += ['/bin/bash','-x',]
+        command += ['/usr/sbin/vuseradd', ]
         if 'attributes' in rec and 'isolate_loopback' in rec['attributes'] and rec['attributes']['isolate_loopback'] == '1':
-            extra = "-i"
+            command += [ "-i",]
+        # the vsliver imge to use
+        command += [ '-t', vref, ]
+        # slice name
+        command += [ name, ]            
 #        logger.log_call(['/usr/sbin/vuseradd', '-t', vref, name, ], timeout=15*60)
-        logger.log_call(['/bin/bash','-x','/usr/sbin/vuseradd', extra, '-t', vref, name, ], timeout=15*60)
+        logger.log_call(command, timeout=15*60)
         # export slicename to the slice in /etc/slicename
         file('/vservers/%s/etc/slicename' % name, 'w').write(name)
         file('/vservers/%s/etc/slicefamily' % name, 'w').write(vref)
@@ -180,7 +186,7 @@ class Sliver_VS(accounts.Account, vserver.VServer):
             if code:
                 logger.log("vsliver_vs: %s: Installed new initscript in %s"%(self.name,sliver_initscript))
                 if self.is_running():
-                    # Only need to rerun the initscript if the vserver is
+                     # Only need to rerun the initscript if the vserver is
                     # already running. If the vserver isn't running, then the
                     # initscript will automatically be started by
                     # /etc/rc.d/vinit when the vserver is started.