Skip to content

Bugfix add trailing slashes for Docker hub API client#862

Closed
tonybaloney wants to merge 1 commit into
apache:trunkfrom
tonybaloney:fix_docker_hub
Closed

Bugfix add trailing slashes for Docker hub API client#862
tonybaloney wants to merge 1 commit into
apache:trunkfrom
tonybaloney:fix_docker_hub

Conversation

@tonybaloney

@tonybaloney tonybaloney commented Sep 22, 2016

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

LGTM

@tonybaloney

Copy link
Copy Markdown
Contributor Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants