# Docker: docker-py updated to 0.3.0 and broke Ansible's docker module - questions about fixing it

**URL:** <https://forum.ansible.com/t/docker-docker-py-updated-to-0-3-0-and-broke-ansibles-docker-module-questions-about-fixing-it/14646>\
**Category:** Ansible Developer\
**Created:** [February 25, 2014, 2:08am UTC](https://forum.ansible.com/t/docker-docker-py-updated-to-0-3-0-and-broke-ansibles-docker-module-questions-about-fixing-it/14646 "2014-02-25T02:08:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Conner](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Joshua\_Conner](https://forum.ansible.com/u/Joshua_Conner)\
**Post date:** [February 25, 2014, 2:08am UTC](https://forum.ansible.com/t/docker-docker-py-updated-to-0-3-0-and-broke-ansibles-docker-module-questions-about-fixing-it/14646/1 "2014-02-25T02:08:42Z")

</div>

Hey all!

Ansible’s docker module depends on [docker-py](https://github.com/dotcloud/docker-py) (Python bindings for the Docker API), and docker-py just pushed a minor-version update bump that contains some changes that break the docker module in Ansible as it is. I’d be happy to push fixes to support this but before I do, I had a few questions:

1. Is this something we even want? The changes are pretty trivial, but it’ll be tricky to make it completely transparent which version of `docker-py` we’re working with, as newer versions of the Docker API return different info about each container than older versions do.
2. How do we deal with backwards-compatibility between versions? Right now there doesn’t seem to be a really good way to tell what version of `docker-py` we’re working with, which complicates things (I do have a super-simple PR for `docker-py` open for that here: [https://github.com/dotcloud/docker-py/pull/168](https://github.com/dotcloud/docker-py/pull/168)).
3. Is [https://github.com/ansible/ansible/pull/5639](https://github.com/ansible/ansible/pull/5639) going to be reviewed/merged in the near-ish future? If it were, it would be a little easier to base future changes off that PR rather than trying to merge later I’d guess.  
Thanks in advance! Let me know if you have any questions.

Josh

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [February 25, 2014, 3:00am UTC](https://forum.ansible.com/t/docker-docker-py-updated-to-0-3-0-and-broke-ansibles-docker-module-questions-about-fixing-it/14646/2 "2014-02-25T03:00:27Z")

</div>

So, to better understand the backwards incompatibility, is it due to upgrading the default API version to 1.8 from 1.6?

If so, I think that should be pretty easy to handle, by setting version=“1.6” in the docker.client.Client instantiation.

Ideally however, specifying a newer API would improve things, since there are some “inconsistencies” with the 1.6 API.

Maybe we can create a “map” of what different return keys mean for different docker API versions, which could allow us to map the responses from docker-py to a standard output? This could even enable us to make the API version a configurable attribute for the modules.

---

<div class="post-metadata">

**Author:** ![Joshua\_Conner](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Joshua\_Conner](https://forum.ansible.com/u/Joshua_Conner)\
**Post date:** [February 25, 2014, 6:40pm UTC](https://forum.ansible.com/t/docker-docker-py-updated-to-0-3-0-and-broke-ansibles-docker-module-questions-about-fixing-it/14646/3 "2014-02-25T18:40:40Z")

</div>

> So, to better understand the backwards incompatibility, is it due to upgrading the default API version to 1.8 from 1.6?
> 
> If so, I think that should be pretty easy to handle, by setting version=“1.6” in the docker.client.Client instantiation.

There are (easy-to-fix, so far, but still breaking) incompatibilities in the actual Python bindings as well as changes in returned data from API versions.

Setting `version="1.6"` could help with getting consistent data returned, but that alone won’t make Ansible’s docker module work with 0.3.0.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 25, 2014, 6:52pm UTC](https://forum.ansible.com/t/docker-docker-py-updated-to-0-3-0-and-broke-ansibles-docker-module-questions-about-fixing-it/14646/4 "2014-02-25T18:52:37Z")

</div>

As docker is reasonably unstable right now, I’m content to require and check for the latest and keep updating things.

I am hoping Docker figures out API compat in the future 🙂
