On Tue, Sep 22, 2015 at 09:10:48AM +0200, Cedric Bosdonnat wrote: > On Mon, 2015-09-21 at 22:12 +0200, Cedric Bosdonnat wrote: > > On Mon, 2015-09-21 at 15:12 +0100, Daniel P. Berrange wrote: > > > The Red Hat docker registry (registry.access.redhat.com) does > > > not set any X-Docker-Token HTTP header in its responses. Change > > > the code so it only passes around this header if it is actually > > > present. > > > > > > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx> > > > --- > > > libvirt-sandbox/image/sources/DockerSource.py | 12 ++++++++---- > > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > > > diff --git a/libvirt-sandbox/image/sources/DockerSource.py b/libvirt-sandbox/image/sources/DockerSource.py > > > index f367c8f..78b2a53 100644 > > > --- a/libvirt-sandbox/image/sources/DockerSource.py > > > +++ b/libvirt-sandbox/image/sources/DockerSource.py > > > @@ -83,10 +83,14 @@ class DockerSource(Source): > > > checksums = {} > > > for layer in data: > > > pass > > > + > > > + headers = {} > > > + if token is not None: > > > + headers["Authorization"] = "Token" + token I accidentally lost the trailing space after the word "Token" > > > (data, res) = self._get_json(template, > > > registryendpoint, > > > "/v1/repositories" + template.path + "/tags", > > > - { "Authorization": "Token " + token }) > > > + headers) 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