On Tue, Sep 22, 2015 at 10:40:02AM +0200, Cedric Bosdonnat wrote:
On Mon, 2015-09-21 at 15:45 +0100, Daniel P. Berrange wrote:
> - def _get_url(self,server, path, headers):
> - url = "https://" + server + path
> + def _get_url(self, template, server, path, headers):
> + if template.protocol is None:
> + protocol = "https"
> + else:
> + protocol = template.protocol
> +
> + if server is None:
> + if template.hostname is None:
> + server = "index.docker.io"
> + else:
> + if template.port is not None:
> + server = template.hostname + ":" + template.port
This doesn't fly, port is an int, we need to have it in this form:
server = "%s:%d" % (template.hostname, template.port)
Good catch, I missed that
> + def __repr__(self):
> + if self.protocol is not None:
> + scheme = self.source + "+" + self.protocol
> + else:
> + scheme = self.source
> + if self.hostname:
> + if self.port:
> + netloc = self.hostname + ":" + self.port
This doesn't work, python requires to put it this way:
netloc = "%s:%d" % (self.hostname, self.port)
Yep, wil do
Regards,
Daniel
--
|:
http://berrange.com -o-
http://www.flickr.com/photos/dberrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|:
http://entangle-photo.org -o-
http://live.gnome.org/gtk-vnc :|