From cde292cc430aecc338228a71265dbedad1de0099 Mon Sep 17 00:00:00 2001 From: Hannes Ljungberg Date: Mon, 14 Jan 2019 11:58:05 +0100 Subject: [PATCH] =?UTF-8?q?docker=5Fswarm=5Fservice:=20Don=E2=80=99t=20add?= =?UTF-8?q?=20difference=20when=20update=5Forder=20is=20None=20(#50655)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Don’t add difference when update_order is None * Add changelog fragment --- .../50655-docker_swarm_service-update_order-idempotency.yml | 2 ++ lib/ansible/modules/cloud/docker/docker_swarm_service.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml diff --git a/changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml b/changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml new file mode 100644 index 00000000000..2239d221212 --- /dev/null +++ b/changelogs/fragments/50655-docker_swarm_service-update_order-idempotency.yml @@ -0,0 +1,2 @@ +bugfixes: +- "docker_swarm_service - fixing falsely reporting ``update_order`` as changed when option is not used." diff --git a/lib/ansible/modules/cloud/docker/docker_swarm_service.py b/lib/ansible/modules/cloud/docker/docker_swarm_service.py index dede723c226..0294abc8ce9 100644 --- a/lib/ansible/modules/cloud/docker/docker_swarm_service.py +++ b/lib/ansible/modules/cloud/docker/docker_swarm_service.py @@ -719,7 +719,7 @@ class DockerService(DockerBaseClass): differences.add('update_monitor', parameter=self.update_monitor, active=os.update_monitor) if self.update_max_failure_ratio != os.update_max_failure_ratio: differences.add('update_max_failure_ratio', parameter=self.update_max_failure_ratio, active=os.update_max_failure_ratio) - if self.update_order != os.update_order: + if self.update_order is not None and self.update_order != os.update_order: differences.add('update_order', parameter=self.update_order, active=os.update_order) if self.image != os.image.split('@')[0]: differences.add('image', parameter=self.image, active=os.image.split('@')[0])