autotest: Respect url protocol in RPC client library.
BUG=chromium:795874
TEST=Manually run atest and dut-status commands against http and https
servers.
Change-Id: I4b609101f3d48cd46c766c04d72ac9a6a3299f8b
diff --git a/cli/rpc.py b/cli/rpc.py
index 4ac39a0..d97650b 100644
--- a/cli/rpc.py
+++ b/cli/rpc.py
@@ -25,12 +25,7 @@
web_server = GLOBAL_CONFIG.get_config_value(
'SERVER', 'hostname', default=DEFAULT_SERVER)
- # if the name doesn't start with http://,
- # nonexistant hosts get an obscure error
- if (not web_server.startswith('http://') and
- not web_server.startswith('https://')):
- web_server = 'http://' + web_server
-
+ web_server = rpc_client_lib.add_protocol(web_server)
return web_server