[py-svn] r34756 - py/dist/py/test/rsession
fijal at codespeak.net
fijal at codespeak.net
Sun Nov 19 16:35:08 CET 2006
Author: fijal
Date: Sun Nov 19 16:35:06 2006
New Revision: 34756
Modified:
py/dist/py/test/rsession/hostmanage.py
Log:
Make a proper handling of tests for hosts that we don't want to create connection to.
Modified: py/dist/py/test/rsession/hostmanage.py
==============================================================================
--- py/dist/py/test/rsession/hostmanage.py (original)
+++ py/dist/py/test/rsession/hostmanage.py Sun Nov 19 16:35:06 2006
@@ -27,7 +27,8 @@
else:
return base in self.rsync_roots
-def prepare_gateway(sshosts, relpath, rsync_roots, optimise_localhost, remote_python, pkgdir):
+def prepare_gateway(sshosts, relpath, rsync_roots, optimise_localhost,
+ remote_python, pkgdir, real_create=True):
hosts = []
for num, host in enumerate(sshosts):
if host != 'localhost' or not optimise_localhost:
@@ -39,18 +40,21 @@
# XXX: because of NFS we do create different directories
# otherwise, .pyc files overlap
remoterootpath += "-" + host
- # for tests we want to use somtehing different
- if host == 'localhost' and optimise_localhost is False:
- from py.__.execnet.register import PopenCmdGateway
- gw = PopenCmdGateway("cd ~/%s; python -u -c 'exec input()'" % remoterootpath)
- if not remoterootpath.startswith("/"):
- remoteroopath = "~/" + remoterootpath
- else:
- if remote_python is None:
- gw = py.execnet.SshGateway(host)
+ if real_create:
+ # for tests we want to use somtehing different
+ if host == 'localhost' and optimise_localhost is False:
+ from py.__.execnet.register import PopenCmdGateway
+ gw = PopenCmdGateway("cd ~/%s; python -u -c 'exec input()'" % remoterootpath)
+ if not remoterootpath.startswith("/"):
+ remoteroopath = "~/" + remoterootpath
else:
- gw = py.execnet.SshGateway(host, remotepython=remote_python)
-
+ if remote_python is None:
+ gw = py.execnet.SshGateway(host)
+ else:
+ gw = py.execnet.SshGateway(host, remotepython=remote_python)
+ else:
+ gw = None
+
hosts.append((num, host, gw, remoterootpath))
else:
if remote_python is None:
@@ -71,7 +75,7 @@
exc_info = [None]
hosts = prepare_gateway(sshhosts, relpath, rsync_roots, optimise_localhost,
- remote_python, pkgdir)
+ remote_python, pkgdir, real_create=do_sync)
# rsyncing
rsynced = {}
More information about the py-svn
mailing list