aboutsummaryrefslogtreecommitdiff
path: root/qa
diff options
context:
space:
mode:
authorwhythat <yuri.zhykin@gmail.com>2016-07-25 01:30:28 +0300
committerLuke Dashjr <luke-jr+git@utopios.org>2016-09-21 02:43:47 +0000
commite111904a76774c9912189f29ad82ad3424905507 (patch)
tree00c3bf6f1805a50e24cbc0793b8fd18276fe03a3 /qa
parent69d1cd202d432bd6b8a6cda2187c148bcf1f6c2e (diff)
downloadbitcoin-e111904a76774c9912189f29ad82ad3424905507.tar.xz
[qa]: add parsing for '<host>:<port>' argument form to rpc_url()
Github-Pull: #8400 Rebased-From: 0ff4375c93bd159233282de5a33ad2e6c1e79841
Diffstat (limited to 'qa')
-rw-r--r--qa/rpc-tests/test_framework/util.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/qa/rpc-tests/test_framework/util.py b/qa/rpc-tests/test_framework/util.py
index 32fe79efc3..8aa34265c5 100644
--- a/qa/rpc-tests/test_framework/util.py
+++ b/qa/rpc-tests/test_framework/util.py
@@ -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):
'''