Fix the xen-api-server option parsing, so that we default to listening on

all interfaces when only a port is given.

This was broken by cset 14601:966c65f0ddba.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
Ewan Mellor committed 2007-03-29 15:22:02 +01:00
1 parent b4fffaec01
commit ebbc8fb301
1 file changed
+10 -10
+10 -10
View File
@@ -188,21 +188,22 @@ def _loadConfig(servers, root, reload):
for server_cfg in api_cfg:
# Parse the xen-api-server config
host = 'localhost'
port = 0
use_tcp = False
ssl_key_file = None
ssl_cert_file = None
auth_method = XendAPI.AUTH_NONE
hosts_allowed = None
host_addr = server_cfg[0].split(':', 1)
if len(host_addr) == 1 and host_addr[0].lower() == 'unix':
use_tcp = False
elif len(host_addr) == 1:
use_tcp = True
port = int(host_addr[0])
elif len(host_addr) == 2:
if len(host_addr) == 1:
if host_addr[0].lower() == 'unix':
use_tcp = False
host = 'localhost'
port = 0
else:
use_tcp = True
host = ''
port = int(host_addr[0])
else:
use_tcp = True
host = str(host_addr[0])
port = int(host_addr[1])
@@ -213,7 +214,6 @@ def _loadConfig(servers, root, reload):
if len(server_cfg) > 2:
hosts_allowed = server_cfg[2] or None
if len(server_cfg) > 4:
# SSL key and cert file
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.