From: Tony Mack Date: Tue, 8 Apr 2008 18:15:57 +0000 (+0000) Subject: -added get_path() method X-Git-Tag: tests-4.2-4~66 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=4b4ad6c12111dc6ebe6fc88b8b6986015a6b6718;p=tests.git -added get_path() method --- 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)