From e5f6ae767d78a2213eac2d52bade3dfdfe620730 Mon Sep 17 00:00:00 2001 From: Mazz Mosley Date: Thu, 16 Jul 2015 10:50:06 +0100 Subject: [PATCH] Merge pull request #1704 from aanand/fix-timeout-type Make sure up/restart/stop timeout is an int (cherry picked from commit c7dccccd1fa4dc2fe6f65d4a839a16567adbee9d) Signed-off-by: Aanand Prasad --- compose/cli/main.py | 6 +++--- tests/integration/state_test.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compose/cli/main.py b/compose/cli/main.py index d5d15177c..ba4445735 100644 --- a/compose/cli/main.py +++ b/compose/cli/main.py @@ -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, diff --git a/tests/integration/state_test.py b/tests/integration/state_test.py index 95fcc49de..fb91bc249 100644 --- a/tests/integration/state_test.py +++ b/tests/integration/state_test.py @@ -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, )