ClusterHQ/flocker — pull request #149 by wallrj (2014-06-26 14:35:08+00:00)
Title: GearClient.add ports argument

In this branch I've:
* Added a `ports` argument to `GearClient.add` , which
* accepts a `list` of `PortMap` instances, and
* defaults to an empty `list` .
* Added a `PortMap` record type.
* Added functional tests which start a gear unit running a simple http server and
* sends an HTTP request to the configured external port
* checks the HTTP response contains the expected body

Things I'm not sure about
* whether to add custom exceptions for the case where the chosen external port is already assigned
* whether to allow setting a protocol (tcp, udp) and IP address as part of the port mapping
* whether the `loop_until2` function is necessary and
* whether it would be better to add a looping call to `systemctl is-active` to wait for the container unit to be ready, rather than just continually attempting http requests.