PATCH: Correct deletion logic for Host.UploadAndRun
Mark Mitchell
mark at codesourcery.com
Mon Sep 4 00:25:03 UTC 2006
Joseph Myers noticed that the UploadAndRun method did not actually
delete files on the remote host after running them, despite the fact
that it is documented as doing so.
This patch corrects that oversight, so that files are indeed deleted.
Committed.
--
Mark Mitchell
CodeSourcery
mark at codesourcery.com
(650) 331-3385 x713
2006-09-03 Mark Mitchell <mark at codesourcery.com>
* qm/host.py (Host.UploadAndRun): Correct logic for deleting files.
Index: qm/host.py
===================================================================
RCS file: /home/qm/Repository/qm/qm/host.py,v
retrieving revision 1.4
diff -c -5 -p -r1.4 host.py
*** qm/host.py 18 Aug 2006 00:42:27 -0000 1.4
--- qm/host.py 4 Sep 2006 00:22:16 -0000
*************** class Host(Extension):
*** 152,167 ****
The program is uploaded to the default directory on the remote
host, run, and then deleted."""
self.UploadFile(path)
! result = self.Run(os.path.basename(path),
arguments,
environment,
timeout,
relative = True)
! self.DeleteFile(path)
return result
def DeleteFile(self, remote_file):
"""Delete the 'remote_file'.
--- 152,168 ----
The program is uploaded to the default directory on the remote
host, run, and then deleted."""
self.UploadFile(path)
! basename = os.path.basename(path)
! result = self.Run(basename,
arguments,
environment,
timeout,
relative = True)
! self.DeleteFile(basename)
return result
def DeleteFile(self, remote_file):
"""Delete the 'remote_file'.
More information about the qmtest
mailing list