From 3112d3920988fde5afa35d2dadbb5298db3a77da Mon Sep 17 00:00:00 2001 From: Nikolay Murga Date: Fri, 20 Jul 2018 12:53:44 +0300 Subject: [PATCH 1/2] Add 'rollback' command as allowed for failure_action Signed-off-by: Nikolay Murga --- docker/types/services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/types/services.py b/docker/types/services.py index 31f4750f..a914cef6 100644 --- a/docker/types/services.py +++ b/docker/types/services.py @@ -371,7 +371,7 @@ class UpdateConfig(dict): delay (int): Amount of time between updates. failure_action (string): Action to take if an updated task fails to run, or stops running during the update. Acceptable values are - ``continue`` and ``pause``. Default: ``continue`` + ``continue``, ``rollback`` and ``pause``. Default: ``continue`` monitor (int): Amount of time to monitor each updated task for failures, in nanoseconds. max_failure_ratio (float): The fraction of tasks that may fail during @@ -385,7 +385,7 @@ class UpdateConfig(dict): self['Parallelism'] = parallelism if delay is not None: self['Delay'] = delay - if failure_action not in ('pause', 'continue'): + if failure_action not in ('pause', 'continue', 'rollback'): raise errors.InvalidArgument( 'failure_action must be either `pause` or `continue`.' ) From 24fff59bd95d077a523496a942225a074707bc08 Mon Sep 17 00:00:00 2001 From: Nikolay Murga Date: Fri, 20 Jul 2018 13:20:19 +0300 Subject: [PATCH 2/2] Add documentation for delay property Signed-off-by: Nikolay Murga --- docker/types/services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/types/services.py b/docker/types/services.py index a914cef6..29407638 100644 --- a/docker/types/services.py +++ b/docker/types/services.py @@ -368,7 +368,7 @@ class UpdateConfig(dict): parallelism (int): Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism). Default: 0. - delay (int): Amount of time between updates. + delay (int): Amount of time between updates, in nanoseconds. failure_action (string): Action to take if an updated task fails to run, or stops running during the update. Acceptable values are ``continue``, ``rollback`` and ``pause``. Default: ``continue``