mirror of https://github.com/docker/compose.git
Merge pull request #1704 from aanand/fix-timeout-type
Make sure up/restart/stop timeout is an int
This commit is contained in:
commit
c7dccccd1f
|
@ -405,7 +405,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):
|
||||||
|
@ -418,7 +418,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):
|
||||||
|
@ -461,7 +461,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)
|
||||||
|
|
||||||
to_attach = project.up(
|
to_attach = project.up(
|
||||||
service_names=service_names,
|
service_names=service_names,
|
||||||
|
|
|
@ -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,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue