[jira] [Commented] (LIBCLOUD-850) Docker Driver missing '/' prior to URI

2016-10-09 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on LIBCLOUD-850:
--

Commit 053d57469b502e5e548e2bbfa0322ec018387764 in libcloud's branch 
refs/heads/trunk from [~mloria]
[ https://git-wip-us.apache.org/repos/asf?p=libcloud.git;h=053d574 ]

fix LIBCLOUD-850


> 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 "", line 1, in 
> 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)


[jira] [Commented] (LIBCLOUD-850) Docker Driver missing '/' prior to URI

2016-10-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LIBCLOUD-850:
-

Github user asfgit closed the pull request at:

https://github.com/apache/libcloud/pull/874


> 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 "", line 1, in 
> 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)


[jira] [Commented] (LIBCLOUD-850) Docker Driver missing '/' prior to URI

2016-09-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on LIBCLOUD-850:
-

GitHub user InAnimaTe opened a pull request:

https://github.com/apache/libcloud/pull/874

[LIBCLOUD-850] Docker Driver missing '/' prior to URI

## Fix missing '/' in driver uri's

### Description

This is a quick 2 line change that enables a proper check for prepending 
slash on a uri so drivers can successfully still work without explicitly 
defining a `/`. This change was inspired by the `docker` driver not working 
when I first instantiated it.

See [this](https://issues.apache.org/jira/browse/LIBCLOUD-850) issue for 
more.

### Status

- done, ready for review

### Checklist (tick everything that applies)

- [x] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ArroyoNetworks/libcloud slash_fix

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/libcloud/pull/874.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #874


commit 053d57469b502e5e548e2bbfa0322ec018387764
Author: Mario Loria 
Date:   2016-09-28T20:11:23Z

fix LIBCLOUD-850




> 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 "", line 1, in 
> 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)


[jira] [Commented] (LIBCLOUD-850) Docker Driver missing '/' prior to URI

2016-09-28 Thread Mario Loria (JIRA)

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

Mario Loria commented on LIBCLOUD-850:
--

I'm actually probably going to submit a PR today to fix this using the method 
Matthew Ellison posted. 

I'll link it here when I do ;)

> 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 "", line 1, in 
> 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)


[jira] [Commented] (LIBCLOUD-850) Docker Driver missing '/' prior to URI

2016-09-27 Thread SanketDG (JIRA)

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

SanketDG commented on LIBCLOUD-850:
---

Can I get assigned to this? I'd like to do this.

> 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 "", line 1, in 
> 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)


[jira] [Commented] (LIBCLOUD-850) Docker Driver missing '/' prior to URI

2016-09-02 Thread Matthew Ellison (JIRA)

[ 
https://issues.apache.org/jira/browse/LIBCLOUD-850?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 "", line 1, in 
> 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)