Use http port from config while checking hub

On check_hub_ready
This commit is contained in:
Dongmok Shin
2020-07-21 14:36:53 +09:00
committed by GeorgianaElena
parent 66c07e0d25
commit cbfbec1b38

View File

@@ -239,8 +239,10 @@ def remove_config_value(config_path, key_path, value):
yaml.dump(config, f) yaml.dump(config, f)
def check_hub_ready(): def check_hub_ready():
from .configurer import load_config
http_port = load_config()['http']['port']
try: try:
r = requests.get('http://127.0.0.1:80/hub/api', verify=False) r = requests.get('http://127.0.0.1:%d/hub/api' % http_port, verify=False)
return r.status_code == 200 return r.status_code == 200
except: except:
return False return False