Handle CLI wildcard addresses properly

If the local API instance is listening on a wildcard, connect to
127.0.0.1 instead.
This commit is contained in:
Joshua Boniface 2020-02-16 20:01:24 -05:00
parent 90f965f516
commit b16e2b4925
1 changed files with 3 additions and 0 deletions

View File

@ -87,6 +87,9 @@ def get_config(store_data, cluster=None):
host, port, scheme, api_key = read_from_yaml(cfgfile) host, port, scheme, api_key = read_from_yaml(cfgfile)
else: else:
return { 'badcfg': True } return { 'badcfg': True }
# Handle an all-wildcard address
if host == '0.0.0.0':
host = '127.0.0.1'
else: else:
# This is a static configuration, get the raw details # This is a static configuration, get the raw details
host = cluster_details['host'] host = cluster_details['host']