Skip to content

Commit

Permalink
Fix ftests/parallel/test_remote.py.
Browse files Browse the repository at this point in the history
The ssh-based remote procedure call was broken because of py3k compat.
  • Loading branch information
yungyuc committed Jul 28, 2016
1 parent 5a66ad0 commit 74bc029
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ script:
- cd ${TRAVIS_BUILD_DIR}
- python setup.py build_ext --inplace
- nosetests --with-doctest
- nosetests ftests/parallel/test_builtin.py
- nosetests ftests/parallel/test_rpc.py
- nosetests ftests/parallel/*
# Package
- cd ${TRAVIS_BUILD_DIR}
- contrib/release.sh
4 changes: 2 additions & 2 deletions contrib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ tar xfz SOLVCON-${SCVER}.tar.gz
cd SOLVCON-${SCVER}
python setup.py build_ext --inplace
# test.
PYTHONPATH=`pwd`
nosetests --with-doctest
nosetests ftests/parallel/test_builtin.py
nosetests ftests/parallel/test_rpc.py
nosetests ftests/parallel/*
3 changes: 2 additions & 1 deletion solvcon/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,13 @@ def create_worker_ssh(self, node, authkey,
raise IOError('remote port detection fails')
# create remote worker objects and return.
pdata = str(profiler_data).replace("'", '"')
authkeystr = authkey.decode("utf8")
remote([
'import os',
'os.chdir("%s")' % os.path.abspath(os.getcwd()),
'from solvcon.rpc import Worker',
'wkr = Worker(None, profiler_data=%s)' % pdata,
'wkr.run(("%s", %d), "%s")' % (node.address, port, authkey),
'wkr.run(("%s", %d), b"%s")' % (node.address, port, authkeystr),
], envar=envar)
return port

Expand Down
2 changes: 1 addition & 1 deletion solvcon/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ def Client(address, family=None, authkey=None):
timeout = time.time() + CLIENT_TIMEOUT
family = family or guess_family(address)
# create socket.
skt = socket.socket(getattr(socket, family))
while True:
skt = socket.socket(getattr(socket, family))
try:
skt.connect(address)
except socket.error as e:
Expand Down

0 comments on commit 74bc029

Please sign in to comment.