Merge pull request #1706 from aanand/bump-1.3.3

Bump 1.3.3
This commit is contained in:
Aanand Prasad 2015-07-16 11:40:20 +01:00
commit 29ceef6d93
7 changed files with 33 additions and 8 deletions

View File

@ -1,6 +1,14 @@
Change log Change log
========== ==========
1.3.3 (2015-07-15)
------------------
Two regressions have been fixed:
- When stopping containers gracefully, Compose was setting the timeout to 0, effectively forcing a SIGKILL every time.
- Compose would sometimes crash depending on the formatting of container data returned from the Docker API.
1.3.2 (2015-07-14) 1.3.2 (2015-07-14)
------------------ ------------------

View File

@ -1,3 +1,3 @@
from __future__ import unicode_literals from __future__ import unicode_literals
__version__ = '1.3.2' __version__ = '1.3.3'

View File

@ -403,7 +403,7 @@ class TopLevelCommand(Command):
-t, --timeout TIMEOUT Specify a shutdown timeout in seconds. -t, --timeout TIMEOUT Specify a shutdown timeout in seconds.
(default: 10) (default: 10)
""" """
timeout = float(options.get('--timeout') or DEFAULT_TIMEOUT) timeout = int(options.get('--timeout') or DEFAULT_TIMEOUT)
project.stop(service_names=options['SERVICE'], timeout=timeout) project.stop(service_names=options['SERVICE'], timeout=timeout)
def restart(self, project, options): def restart(self, project, options):
@ -416,7 +416,7 @@ class TopLevelCommand(Command):
-t, --timeout TIMEOUT Specify a shutdown timeout in seconds. -t, --timeout TIMEOUT Specify a shutdown timeout in seconds.
(default: 10) (default: 10)
""" """
timeout = float(options.get('--timeout') or DEFAULT_TIMEOUT) timeout = int(options.get('--timeout') or DEFAULT_TIMEOUT)
project.restart(service_names=options['SERVICE'], timeout=timeout) project.restart(service_names=options['SERVICE'], timeout=timeout)
def up(self, project, options): def up(self, project, options):
@ -459,7 +459,7 @@ class TopLevelCommand(Command):
allow_recreate = not options['--no-recreate'] allow_recreate = not options['--no-recreate']
smart_recreate = options['--x-smart-recreate'] smart_recreate = options['--x-smart-recreate']
service_names = options['SERVICE'] service_names = options['SERVICE']
timeout = float(options.get('--timeout') or DEFAULT_TIMEOUT) timeout = int(options.get('--timeout') or DEFAULT_TIMEOUT)
project.up( project.up(
service_names=service_names, service_names=service_names,

View File

@ -149,7 +149,7 @@ def _get_legacy_containers_iter(
for service in services: for service in services:
for container in containers: for container in containers:
if LABEL_VERSION in container['Labels']: if LABEL_VERSION in (container.get('Labels') or {}):
continue continue
name = get_container_name(container) name = get_container_name(container)

View File

@ -27,7 +27,7 @@ First, install Docker version 1.6 or greater:
To install Compose, run the following commands: To install Compose, run the following commands:
curl -L https://github.com/docker/compose/releases/download/1.3.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose curl -L https://github.com/docker/compose/releases/download/1.3.3/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose
> Note: If you get a "Permission denied" error, your `/usr/local/bin` directory probably isn't writable and you'll need to install Compose as the superuser. Run `sudo -i`, then the two commands above, then `exit`. > Note: If you get a "Permission denied" error, your `/usr/local/bin` directory probably isn't writable and you'll need to install Compose as the superuser. Run `sudo -i`, then the two commands above, then `exit`.

View File

@ -1,4 +1,5 @@
import unittest import unittest
from mock import Mock
from docker.errors import APIError from docker.errors import APIError
@ -64,6 +65,22 @@ class UtilitiesTestCase(unittest.TestCase):
legacy.is_valid_name("composetest_web_lol_1", one_off=True), legacy.is_valid_name("composetest_web_lol_1", one_off=True),
) )
def test_get_legacy_containers_no_labels(self):
client = Mock()
client.containers.return_value = [
{
"Id": "abc123",
"Image": "def456",
"Name": "composetest_web_1",
"Labels": None,
},
]
containers = list(legacy.get_legacy_containers(
client, "composetest", ["web"]))
self.assertEqual(len(containers), 1)
class LegacyTestCase(DockerClientTestCase): class LegacyTestCase(DockerClientTestCase):

View File

@ -13,7 +13,7 @@ from .testcases import DockerClientTestCase
class ProjectTestCase(DockerClientTestCase): class ProjectTestCase(DockerClientTestCase):
def run_up(self, cfg, **kwargs): def run_up(self, cfg, **kwargs):
kwargs.setdefault('smart_recreate', True) kwargs.setdefault('smart_recreate', True)
kwargs.setdefault('timeout', 0.1) kwargs.setdefault('timeout', 1)
project = self.make_project(cfg) project = self.make_project(cfg)
project.up(**kwargs) project.up(**kwargs)
@ -171,7 +171,7 @@ def converge(service,
plan, plan,
insecure_registry=insecure_registry, insecure_registry=insecure_registry,
do_build=do_build, do_build=do_build,
timeout=0.1, timeout=1,
) )