def _get_monhelper_url(name): sup_url = supcast.get_url(name) url = urllib.parse.urlparse(sup_url) port = url.port if port is None: raise ValueError("no port in url: %s" % sup_url) bits = list(url.netloc.partition(str(port))) bits[1] = str(port + 1) new_url = url._replace(netloc=''.join(bits)) return urllib.parse.urlunparse(new_url)
def _get_supervisor(name): url = supcast.get_url(name) supervisor = xmlrpc_client.ServerProxy(url, verbose=False) return supervisor