first working version of .ssh getting exposed to slices
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 17 Feb 2011 14:34:34 +0000 (15:34 +0100)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Thu, 17 Feb 2011 14:34:34 +0000 (15:34 +0100)
done for all slices at this point, next step will handle omf-friendly
slices only

accounts.py
sliver_vs.py

index 59ecedb..74afcff 100644 (file)
@@ -1,5 +1,4 @@
-# $Id$
-# $URL$
+### 
 
 """Functionality common to all account classes.
 
index 2554c2a..a86b3f6 100644 (file)
@@ -23,6 +23,7 @@ import traceback
 import os, os.path
 import time
 from threading import BoundedSemaphore
+import subprocess
 
 # the util-vserver-pl module
 import vserver
@@ -172,7 +173,7 @@ class Sliver_VS(accounts.Account, vserver.VServer):
     # needs to be done before sliver starts
     def expose_ssh_dir (self):
         try:
-            root_ssh="/home/%s/.ssh"
+            root_ssh="/home/%s/.ssh"%self.name
             sliver_ssh="/vservers/%s/home/%s/.ssh"%(self.name,self.name)
             # any of both might not exist yet
             for path in [root_ssh,sliver_ssh]: 
@@ -184,8 +185,9 @@ class Sliver_VS(accounts.Account, vserver.VServer):
             if mounts.find(sliver_ssh)<0:
                 # xxx perform mount
                 subprocess.call("mount --bind -o ro %s %s"%(root_ssh,sliver_ssh),shell=True)
+                logger.log("expose_ssh_dir: %s mounted into slice %s"%(root_ssh,self.name))
         except:
-            logger.log("expose_ssh_dir with slice %s failed"%self.name)
+            logger.log_exc("expose_ssh_dir with slice %s failed"%self.name)
 
     def start(self, delay=0):
         if self.rspec['enabled'] <= 0: