Re: [PATCH v2 sandbox] virt-sandbox-image: switch to use URI to identify templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]