diff --git a/gstlal-inspiral/bin/gstlal_inspiral b/gstlal-inspiral/bin/gstlal_inspiral index a5269caa33e216d7e1eec4171e76cf8d39c8670c..027f1c972721b534955ea399e71e17f6d9236dae 100755 --- a/gstlal-inspiral/bin/gstlal_inspiral +++ b/gstlal-inspiral/bin/gstlal_inspiral @@ -224,18 +224,6 @@ def service_domain(gracedb_search, gracedb_pipeline): return "%s_%s.%s" % (gracedb_pipeline.lower(), gracedb_search.lower(), servicediscovery.DEFAULT_SERVICE_DOMAIN) -def get_rule_from_proxy_route(route): - # Method to trace back the rules defined - # by a PROXY method from the GET methods - # of the original application - if route.method != 'PROXY': - raise ValueError("The route provided is not a PROXY route") - # Make sure we only consider GET methods - # Make sure we don't create links back here - original_rules = [r.rule for r in route.config()['mountpoint.target'].routes if r.method == "GET" and r.rule not in ("/", "/index.html")] - return [route.config()['mountpoint.prefix'][:-1] + r for r in original_rules] # [:-1] removes a / at the end - - # # ============================================================================= # @@ -699,7 +687,7 @@ for output_file_number, (svd_bank_url_dict, output_url, ranking_stat_output_url, netloc = bottle.request.urlparts[1] server_address = "http://%s" % netloc yield "<html><body>\n<h3>%s %s %s %s</h3>\n<p>\n" % (job_tag, os.environ.get("GSTLAL_LL_JOB"), netloc, " ".join(sorted(instruments))) - for rule in sorted(get_rule_from_proxy_route(modified_app.routes[0])): + for rule in sorted(httpinterface.get_rule_from_proxy_route(modified_app.routes[0])): yield "<a href=\"%s%s\">%s</a><br>\n" % (server_address, rule, rule) yield "</p>\n</body></html>" # FIXME: get service-discovery working, then don't do this diff --git a/gstlal/python/httpinterface.py b/gstlal/python/httpinterface.py index 07a24078133b0d923d341824d17f815535dfcf08..d9667ce53abec6cfa41cca0db2430e4ba8abecd5 100644 --- a/gstlal/python/httpinterface.py +++ b/gstlal/python/httpinterface.py @@ -172,3 +172,15 @@ class HTTPServers(list): except Exception as e: if self.verbose: print("failed: %s" % str(e), file=sys.stderr) + + +def get_rule_from_proxy_route(route): + # Method to trace back the rules defined + # by a PROXY method from the GET methods + # of the original application + if route.method != 'PROXY': + raise ValueError("The route provided is not a PROXY route") + # Make sure we only consider GET methods + # Make sure we don't create links back here + original_rules = [r.rule for r in route.config()['mountpoint.target'].routes if r.method == "GET" and r.rule not in ("/", "/index.html")] + return [route.config()['mountpoint.prefix'][:-1] + r for r in original_rules] # [:-1] removes a / at the end