Michael Bennett created LIBCLOUD-894:
----------------------------------------
Summary: DockerContainer Driver misplacements arguments when host
and port are specified
Key: LIBCLOUD-894
URL: https://issues.apache.org/jira/browse/LIBCLOUD-894
Project: Libcloud
Issue Type: Bug
Reporter: Michael Bennett
It appears to be an issue with DockerContainerDriver accepting a user_id
despite its connection class being a subclass of ConnectionUserAndKey.
This causes arguments to get shifted in place when the BaseDriver attempts as
can be seen by this pdb trace:
```python
> /Users/mbennett/.virtualenvs/cloudburst/src/apache-libcloud/libcloud/common/base.py(916)__init__()
-> super(ConnectionUserAndKey, self).__init__(key, secure=secure,
(Pdb) user_id
(Pdb) args
self = <libcloud.container.drivers.docker.DockerConnection object at
0x10fb67f90>
user_id = None
key = False
secure = localhost
host = 12321
port = None
url = None
timeout = None
proxy_url = None
backoff = None
retry_delay = None
(Pdb)
```python
However it appears there may be a bug with BaseDriver, where it never expects
to be passed a user_id argument, and therefore always passes key as the first
positional argument when creating a connection class.
```
def __init__(self, key, secret=None, secure=True, host=None, port=None,
api_version=None, region=None, **kwargs):
self.key = key
self.secret = secret
self.secure = secure
args = [self.key]
...
...
self.connection = self.connectionCls(*args, **conn_kwargs)
```
However ConnectionUserAndKey classes and subclasses appear to expect the
user_id argument to be first. I may just be misinterpreting this but it seems
like a deeper issue
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)