X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2FTestSsh.py;h=b4cc39877a946a356038794c39da7c22c2546eca;hb=560938db174121e93854fd39b66d29be86769864;hp=396d4b6d89aa3e7a5293513e591abdbf544565a6;hpb=66ad1efd9bc816f4f84f68f0132f77600897f84b;p=tests.git diff --git a/system/TestSsh.py b/system/TestSsh.py index 396d4b6..b4cc398 100644 --- a/system/TestSsh.py +++ b/system/TestSsh.py @@ -126,4 +126,15 @@ class TestSsh: scp_command += "%s %s:%s/%s"%(local_file,self.hostname_part(), self.buildname,os.path.basename(local_file) or ".") return utils.system(scp_command) - + + def fetch (self, remote_file, local_file, recursive=False): + if self.is_local(): + command="cp " + if recursive: command += "-r " + command += "%s %s"%(remote_file,local_file) + else: + command="scp " + if recursive: command += "-r " + command += self.key_part() + command += "%s:%s/%s %s"%(self.hostname_part(),self.buildname,remote_file,local_file) + utils.system(command)