From e08da5f9837a91f2b6e0fc2f20877d5cec3aa14f Mon Sep 17 00:00:00 2001 From: Jeffrey Zhang Date: Tue, 11 Sep 2018 15:20:31 +0800 Subject: [PATCH] Handle role properly when it is changed in kolla_keystone_user module Change-Id: I128559f9bcfe48b786a3f52fe4e04bd47cac7a7d Closes-Bug: #1791896 --- docker/kolla-toolbox/kolla_keystone_user.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docker/kolla-toolbox/kolla_keystone_user.py b/docker/kolla-toolbox/kolla_keystone_user.py index e6a56f3c2c..319cf67c82 100644 --- a/docker/kolla-toolbox/kolla_keystone_user.py +++ b/docker/kolla-toolbox/kolla_keystone_user.py @@ -68,6 +68,12 @@ def main(): password=password, default_project=project, domain_id='default') + role_assignments = cloud.keystone_client.role_assignments + assignment = role_assignments.list(user=user, + project=project, + role=role) + if not assignment: + changed = True cloud.grant_role(role, user=user, project=project)