libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Ellison (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LIBCLOUD-850) Docker Driver missing '/' prior to URI
Date Fri, 02 Sep 2016 18:19:22 GMT

    [ https://issues.apache.org/jira/browse/LIBCLOUD-850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15459227#comment-15459227
] 

Matthew Ellison commented on LIBCLOUD-850:
------------------------------------------

Probably the best fix is to prevent this from ever happening again on accident:

{code:title=common/base.py (line 869)}
    def morph_action_hook(self, action):
        if not action.startswith("/"):
            action = "/" + action
        return self.request_path + action
{code}

> Docker Driver missing '/' prior to URI
> --------------------------------------
>
>                 Key: LIBCLOUD-850
>                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-850
>             Project: Libcloud
>          Issue Type: Bug
>            Reporter: Mario Loria
>            Priority: Critical
>
> Just tried the docker driver and found that it's improperly sending requests to the Docker
API:
> {{http://127.0.0.1:4243v1.24/containers/json?all=1}}
> which yields:
> {code}
> >>> conn.list_containers()
> Traceback (most recent call last):
>   File "<input>", line 1, in <module>
>     conn.list_containers()
>   File "/home/mloria/arrovenv/lib/python3.5/site-packages/libcloud/container/drivers/docker.py
> ", line 279, in list_containers
>     "v%s/containers/json%s" % (self.version, ex)).object
>   File "/home/mloria/arrovenv/lib/python3.5/site-packages/libcloud/common/base.py", line
862, 
> in request
>     response = responseCls(**kwargs)
>   File "/home/mloria/arrovenv/lib/python3.5/site-packages/libcloud/common/base.py", line
179, 
> in __init__
>     headers=self.headers)
> libcloud.common.exceptions.BaseHTTPError: 400 Bad Request
> {code}
> I've verified this by making the same GET request with Postman, which worked properly
(with the missing '/'). Also, Wireshark: http://imgur.com/a/ogEge



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message