From 0890559ab508b54787087aef55e55a260be26634 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 25 Jan 2017 17:57:13 +0100 Subject: [PATCH] Fix OpenStack keystone domain idempotency (#20637) Without this patch, the os_keystone_domain module is not idempotent if the description is empty because the description parameter is None in ansible, but the keystone client returns an empty unicode string. Following the example of other OpenStack modules, this patch fixes the issue by checking whether the module parameter is None before going on to check its value. --- lib/ansible/modules/cloud/openstack/os_keystone_domain.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/openstack/os_keystone_domain.py b/lib/ansible/modules/cloud/openstack/os_keystone_domain.py index b355971e8b5..dce64f80eb3 100644 --- a/lib/ansible/modules/cloud/openstack/os_keystone_domain.py +++ b/lib/ansible/modules/cloud/openstack/os_keystone_domain.py @@ -106,7 +106,8 @@ id: ''' def _needs_update(module, domain): - if domain.description != module.params['description']: + if module.params['description'] is not None and \ + domain.description != module.params['description']: return True if domain.enabled != module.params['enabled']: return True