Merge pull request #598 from dongmok/master

Use http port from config while checking hub
This commit is contained in:
Georgiana Elena
2020-07-28 15:51:20 +03:00
committed by GitHub

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