Ok, looks good. Commited as

http://autotest.kernel.org/changeset/3844

On Mon, Oct 12, 2009 at 11:36 PM, Cao, Chen <k...@redhat.com> wrote:
> Since os.rename requires that the file is in the same partition with
> the dest directory, we would get a python OSError if the result
> directory is mounted to a nfs server (or different partition or
> something else alike).
>
> the traceback would be like:
>
>  Traceback (most recent call last):
>    File "/usr/local/kvm/kvm-test/bin/autotest", line 52, in ?
>      options.log)
>    File "/usr/local/kvm/kvm-test/bin/job.py", line 1274, in runjob
>      myjob.complete(0)
>    File "/usr/local/kvm/kvm-test/bin/job.py", line 798, in complete
>    os.rename(self.state_file, dest)
>  OSError: [Errno 18] Invalid cross-device link
>
> Signed-off-by: Cao, Chen <k...@redhat.com>
> ---
>  client/bin/job.py |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/client/bin/job.py b/client/bin/job.py
> index a1c07cc..ebfb3a3 100755
> --- a/client/bin/job.py
> +++ b/client/bin/job.py
> @@ -938,7 +938,7 @@ class base_job(object):
>         """Clean up and exit"""
>         # We are about to exit 'complete' so clean up the control file.
>         dest = os.path.join(self.resultdir, os.path.basename(self.state_file))
> -        os.rename(self.state_file, dest)
> +        shutil.move(self.state_file, dest)
>
>         self.harness.run_complete()
>         self.disable_external_logging()
> --
> 1.6.0.6
>
> _______________________________________________
> Autotest mailing list
> autot...@test.kernel.org
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
>



-- 
Lucas
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to