Compare commits

..

4 Commits
1.3.2 ... 1.3.3

Author SHA1 Message Date
Aanand Prasad
8cff440800 Bump 1.3.3
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-16 11:21:01 +01:00
Mazz Mosley
e5f6ae767d Merge pull request #1704 from aanand/fix-timeout-type
Make sure up/restart/stop timeout is an int
(cherry picked from commit c7dccccd1f)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-16 11:19:21 +01:00
Aanand Prasad
cd44179305 Merge pull request #1705 from aanand/fix-labels-null
Handle case where /containers/json returns "Labels": null
(cherry picked from commit 7b9664be8e)

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
2015-07-15 17:33:08 +01:00
Aanand Prasad
c3c5b354b8 Merge pull request #1690 from aanand/bump-1.3.2
Bump 1.3.2
2015-07-14 18:04:22 +01:00
7 changed files with 33 additions and 8 deletions

View File

@@ -1,6 +1,14 @@
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)
------------------

View File

@@ -1,3 +1,3 @@
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.
(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)
def restart(self, project, options):
@@ -416,7 +416,7 @@ class TopLevelCommand(Command):
-t, --timeout TIMEOUT Specify a shutdown timeout in seconds.
(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)
def up(self, project, options):
@@ -459,7 +459,7 @@ class TopLevelCommand(Command):
allow_recreate = not options['--no-recreate']
smart_recreate = options['--x-smart-recreate']
service_names = options['SERVICE']
timeout = float(options.get('--timeout') or DEFAULT_TIMEOUT)
timeout = int(options.get('--timeout') or DEFAULT_TIMEOUT)
project.up(
service_names=service_names,

View File

@@ -149,7 +149,7 @@ def _get_legacy_containers_iter(
for service in services:
for container in containers:
if LABEL_VERSION in container['Labels']:
if LABEL_VERSION in (container.get('Labels') or {}):
continue
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:
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
> 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
from mock import Mock
from docker.errors import APIError
@@ -64,6 +65,22 @@ class UtilitiesTestCase(unittest.TestCase):
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):

View File

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