From 570019ee21b24160d984002d17342bd801332333 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 17 Feb 2011 15:34:34 +0100 Subject: [PATCH] first working version of .ssh getting exposed to slices done for all slices at this point, next step will handle omf-friendly slices only --- accounts.py | 3 +-- sliver_vs.py | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/accounts.py b/accounts.py index 59ecedb..74afcff 100644 --- a/accounts.py +++ b/accounts.py @@ -1,5 +1,4 @@ -# $Id$ -# $URL$ +### """Functionality common to all account classes. diff --git a/sliver_vs.py b/sliver_vs.py index 2554c2a..a86b3f6 100644 --- a/sliver_vs.py +++ b/sliver_vs.py @@ -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: -- 2.43.0