Skip to content
Snippets Groups Projects
Commit cc70e6d6 authored by Marius van den Beek's avatar Marius van den Beek
Browse files

Include managers/<manager_name> in HttpPulsarInterface url.

If manager name was specified in the destination parameters, include the
managers/<manager_name> route in the url.
parent 9acc5637
No related branches found
No related tags found
No related merge requests found
...@@ -3,14 +3,12 @@ from abc import abstractmethod ...@@ -3,14 +3,12 @@ from abc import abstractmethod
from string import Template from string import Template
from six import BytesIO from six import BytesIO
from six.moves.urllib.parse import urlencode
from six.moves.urllib.parse import urljoin
try: try:
from six import text_type from six import text_type
except ImportError: except ImportError:
from galaxy.util import unicodify as text_type from galaxy.util import unicodify as text_type
try:
from urllib import urlencode
except ImportError:
from urllib.parse import urlencode
from .util import copy_to_path from .util import copy_to_path
...@@ -85,10 +83,13 @@ class HttpPulsarInterface(PulsarInterface): ...@@ -85,10 +83,13 @@ class HttpPulsarInterface(PulsarInterface):
self.transport = transport self.transport = transport
remote_host = destination_params.get("url") remote_host = destination_params.get("url")
assert remote_host is not None, "Failed to determine url for Pulsar client." assert remote_host is not None, "Failed to determine url for Pulsar client."
if not remote_host.endswith("/"):
remote_host = "%s/" % remote_host
if not remote_host.startswith("http"): if not remote_host.startswith("http"):
remote_host = "http://%s" % remote_host remote_host = "http://%s" % remote_host
if not remote_host.endswith("/"):
remote_host = "%s/" % remote_host
manager = destination_params.get("manager", None)
if manager:
remote_host = urljoin(remote_host, "managers/%s" % manager)
self.remote_host = remote_host self.remote_host = remote_host
self.private_token = destination_params.get("private_token", None) self.private_token = destination_params.get("private_token", None)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment