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.
This commit is contained in:
Colleen Murphy 2017-01-25 17:57:13 +01:00 committed by John R Barker
parent af59781b56
commit 0890559ab5

View file

@ -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