dotcloud/docker-py — pull request #198 by fcoelho (2014-04-09 07:16:33+00:00)
Title: Sanitize create_container input for volumes_from

Client.create_container takes a volumes_from argument that should be: a string, a list of strings, or ``None``. If an empty list or dict is passed instead, docker-py throws a weird error:

```pytb
(env)[root@host ~]# python fail.py
Traceback (most recent call last):
File "fail.py", line 6, in
client.start(container['Id'])
File "/root/env/lib/python2.7/site-packages/docker/client.py", line 742, in start
self._raise_for_status(res)
File "/root/env/lib/python2.7/site-packages/docker/client.py", line 115, in _raise_for_status
raise APIError(e, response, explanation=explanation)
docker.client.APIError: 406 Client Error: Not Acceptable ("Cannot start container c6d6a22391b092de05b12eb97d8787fb976cf180f5db4e4a8d54b74e73f8c422: Container c6d6a22391b092de05b12eb97d8787fb976cf180f5db4e4a8d54b74e73f8c422 not found. Impossible to mount its volumes")
```

This happens on docker 0.9.0 and docker-py 0.3.1. There are a few differences from the output of ``docker inspect`` for a container created with ``volumes_from=None`` or ``volumes_from=[]``. I'll create an issue on [dotcloud/docker](https://github.com/dotcloud/docker) and link it here when it's done.