New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix add trailing slashes for Docker hub API client #862

Closed
wants to merge 1 commit into
base: trunk
from

Conversation

Projects
None yet
2 participants
@tonybaloney
Contributor

tonybaloney commented Sep 22, 2016

Bugfix add trailing slashes for Docker hub API client

Description

The following code snippet fails

from libcloud.container.utils.docker import HubClient
import libcloud.common.exceptions
import libcloud

with open('blah.txt','w') as boo:
    libcloud.enable_debug(boo)
    hub = HubClient()

    try:
        image = hub.get_image('tomcat', '8.0')
    except libcloud.common.exceptions.BaseHTTPError as error:
        print(dir(error))
        print("Waaaaah %s" % error.code)

You can see in the logfile

# -------- begin 4377133392 request ----------
curl -i -X GET -H 'Host: registry.hub.docker.com' -H 'X-LC-Request-ID: 4377133392' -H 'Content-Type: application/json' -H 'Accept-Encoding: gzip,deflate' -H 'User-Agent: libcloud/1.0.0 ' --compress https://registry.hub.docker.com:443/v2/repositories/library/tomcat/tags/8.0
# -------- begin 4377133392:4377127320 response ----------
HTTP/1.1 301 MOVED PERMANENTLY
Transfer-Encoding: chunked
Strict-Transport-Security: max-age=31536000
Server: nginx/1.6.2
Location: https://registry.hub.docker.com/v2/repositories/library/tomcat/tags/8.0/
Date: Thu, 22 Sep 2016 00:21:23 GMT
X-Frame-Options: SAMEORIGIN
Content-Type: text/html; charset=utf-8

0

0

# -------- end 4377133392:4377127320 response ----------

Status

Replace this: describe the PR status. Examples:

  • done, ready for review

Checklist (tick everything that applies)

  • Code linting (required, can be done after the PR checks)
  • Documentation
  • Tests
  • ICLA (required for bigger changes)

cc @arroyonetworks

@InAnimaTe

This comment has been minimized.

Show comment
Hide comment
@InAnimaTe

InAnimaTe Sep 22, 2016

Contributor

LGTM

Contributor

InAnimaTe commented Sep 22, 2016

LGTM

@tonybaloney

This comment has been minimized.

Show comment
Hide comment
@tonybaloney

tonybaloney Sep 22, 2016

Contributor

merging.

Contributor

tonybaloney commented Sep 22, 2016

merging.

@asfgit asfgit closed this in 03af9a0 Sep 22, 2016

asfgit pushed a commit that referenced this pull request Sep 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment