docker/fig — pull request #636 by jjclark1982 (2014-11-12 06:21:20+00:00)
Title: support values of DOCKER_HOST with no explicit protocol

When the `DOCKER_HOST` environment variable does not specify a protocol, `docker` defaults to `"tcp://"` but `fig` dies without saying anything useful. This is very confusing to new users who might expect `fig` to be able to connect under the same circumstances as `docker`.

$ echo $DOCKER_HOST
192.168.59.103:2376

$ docker version
Client version: 1.3.0
Client API version: 1.15
Go version (client): go1.3.3
Git commit (client): c78088f
OS/Arch (client): darwin/amd64
Server version: 1.3.0
Server API version: 1.15
Go version (server): go1.3.3
Git commit (server): c78088f

$ fig ps
Traceback (most recent call last):
File "/usr/local/bin/fig", line 9, in
load_entry_point('fig==1.0.1', 'console_scripts', 'fig')()
File "/Library/Python/2.7/site-packages/fig/cli/main.py", line 31, in main
command.sys_dispatch()
File "/Library/Python/2.7/site-packages/fig/cli/docopt_command.py", line 21, in sys_dispatch
self.dispatch(sys.argv[1:], None)
File "/Library/Python/2.7/site-packages/fig/cli/command.py", line 28, in dispatch
super(Command, self).dispatch(*args, **kwargs)
File "/Library/Python/2.7/site-packages/fig/cli/docopt_command.py", line 24, in dispatch
self.perform_command(*self.parse(argv, global_options))
File "/Library/Python/2.7/site-packages/fig/cli/command.py", line 54, in perform_command
verbose=options.get('--verbose'))
File "/Library/Python/2.7/site-packages/fig/cli/command.py", line 83, in get_project
self.get_client(verbose=verbose))
File "/Library/Python/2.7/site-packages/fig/cli/command.py", line 59, in get_client
client = docker_client()
File "/Library/Python/2.7/site-packages/fig/cli/docker_client.py", line 21, in docker_client
base_url = '%s://%s' % ('https', parts[1])
IndexError: list index out of range

I propose changing the url parsing in `docker_client.py` to support this format without crashing.