From b4d7d1316c387192a4a8b652bd1a095603624179 Mon Sep 17 00:00:00 2001 From: Andrew Audibert Date: Fri, 10 Aug 2018 14:25:21 -0700 Subject: [PATCH] Fix spark hostname probing when date matches worker port --- bin/functions/load_config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/functions/load_config.py b/bin/functions/load_config.py index 61101dcb6..f0c85dc22 100755 --- a/bin/functions/load_config.py +++ b/bin/functions/load_config.py @@ -563,8 +563,9 @@ def probe_masters_slaves_hostnames(): with closing(urllib.urlopen('http://%s:%s' % (HibenchConf['hibench.masters.hostnames'], master_port), proxies={})) as page: worker_hostnames = [] for x in page.readlines(): - if worker_port in x and "worker" in x: - worker_hostnames.append(re.findall("http:\/\/([a-zA-Z\-\._0-9]+):%s" % worker_port, x)[0]) + matches = re.findall("http:\/\/([a-zA-Z\-\._0-9]+):%s" % worker_port, x) + if matches: + worker_hostnames.append(matches[0]) HibenchConf['hibench.slaves.hostnames'] = " ".join(worker_hostnames) HibenchConfRef['hibench.slaves.hostnames'] = "Probed by parsing " + \ 'http://%s:%s' % (HibenchConf['hibench.masters.hostnames'], master_port)