better change reporting for postgres_user groups

This commit is contained in:
Eren Güven 2015-10-08 15:12:45 +02:00
parent 2ae7ada3c9
commit ffffede412

View File

@ -191,8 +191,9 @@ def present(name,
if isinstance(groups, (six.string_types, six.text_type)):
lgroups = lgroups.split(',')
if isinstance(lgroups, list):
if [a for a in lgroups if a not in user_groups]:
update = True
missing_groups = [a for a in lgroups if a not in user_groups]
if missing_groups:
update['groups'] = missing_groups
if mode == 'create' or (mode == 'update' and update):
if __opts__['test']: