From 7302d1af04d014b9c264bce30915ef411382ef8e Mon Sep 17 00:00:00 2001 From: Kajetan Champlewski Date: Fri, 31 May 2019 09:11:20 +0000 Subject: [PATCH 1/2] Handle str in setter for test. Signed-off-by: Kajetan Champlewski --- docker/types/healthcheck.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/types/healthcheck.py b/docker/types/healthcheck.py index 61857c21ce..919c4fd752 100644 --- a/docker/types/healthcheck.py +++ b/docker/types/healthcheck.py @@ -53,6 +53,8 @@ def test(self): @test.setter def test(self, value): + if isinstance(value, six.string_types): + value = ["CMD-SHELL", value] self['Test'] = value @property From dcff8876b1d2eed158e7b80000d82018aa3d8e34 Mon Sep 17 00:00:00 2001 From: Kajetan Champlewski Date: Fri, 31 May 2019 09:13:30 +0000 Subject: [PATCH 2/2] Clean up healtcheck.py docs Signed-off-by: Kajetan Champlewski --- docker/types/healthcheck.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/types/healthcheck.py b/docker/types/healthcheck.py index 919c4fd752..9815018db8 100644 --- a/docker/types/healthcheck.py +++ b/docker/types/healthcheck.py @@ -14,7 +14,7 @@ class Healthcheck(DictType): - Empty list: Inherit healthcheck from parent image - ``["NONE"]``: Disable healthcheck - ``["CMD", args...]``: exec arguments directly. - - ``["CMD-SHELL", command]``: RUn command in the system's + - ``["CMD-SHELL", command]``: Run command in the system's default shell. If a string is provided, it will be used as a ``CMD-SHELL`` @@ -23,9 +23,9 @@ class Healthcheck(DictType): should be 0 or at least 1000000 (1 ms). timeout (int): The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). - retries (integer): The number of consecutive failures needed to + retries (int): The number of consecutive failures needed to consider a container as unhealthy. - start_period (integer): Start period for the container to + start_period (int): Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). """