Skip to content

Commit

Permalink
[qa]: add parsing for '<host>:<port>' argument form to rpc_url()
Browse files Browse the repository at this point in the history
Github-Pull: #8400
Rebased-From: 0ff4375c93bd159233282de5a33ad2e6c1e79841
  • Loading branch information
rodentrabies authored and luke-jr committed Sep 21, 2016
1 parent 69d1cd2 commit e111904
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion qa/rpc-tests/test_framework/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,15 @@ def rpc_auth_pair(n):

def rpc_url(i, rpchost=None):
rpc_u, rpc_p = rpc_auth_pair(i)
return "http://%s:%s@%s:%d" % (rpc_u, rpc_p, rpchost or '127.0.0.1', rpc_port(i))
host = '127.0.0.1'
port = rpc_port(i)
if rpchost:
parts = rpchost.split(':')
if len(parts) == 2:
host, port = parts
else:
host = rpchost
return "http://%s:%s@%s:%d" % (rpc_u, rpc_p, host, int(port))

def wait_for_bitcoind_start(process, url, i):
'''
Expand Down

0 comments on commit e111904

Please sign in to comment.