From 4b4ad6c12111dc6ebe6fc88b8b6986015a6b6718 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Tue, 8 Apr 2008 18:15:57 +0000 Subject: [PATCH] -added get_path() method --- qaapi/qa/Remote.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/qaapi/qa/Remote.py b/qaapi/qa/Remote.py index 67ebb4c..46a327a 100644 --- a/qaapi/qa/Remote.py +++ b/qaapi/qa/Remote.py @@ -3,8 +3,22 @@ import os class Remote: + def get_path(self): + path = "" + if 'host' in self and self['host']: + if self['host'] not in ['localhost', self.config.hostname, None]: + path += "root@host:" + if 'vserver' in self and self['vserver']: + path += '/vservers/%s/' % self['vserver'] + if 'chroot' in self and self['chroot']: + path += self['chroot'] + os.sep + if 'homedir' in self and self['homedir']: + path += self['homedir'] + os.sep + + return path + def get_command(self, command): - options = "" + options = " -o StrictHostKeyChecking=no " # Chroot if necessary if 'chroot' in self and self['chroot']: command = " chroot %s %s" % (self['chroot'], command) -- 2.47.0