From e781b14d1dcce0349b28941619f548e3b83aa375 Mon Sep 17 00:00:00 2001 From: kbaikov Date: Tue, 18 Oct 2016 14:31:12 +0200 Subject: [PATCH] Avoid variables overwrite by keystone default config Keystone would overwrite deployment variables project_domain and user_domain variables with "default" To avoid that DEFAULT_CONFIG is instantiated in the __init__ method now Closes-Bug: 1634474 Change-Id: Ib81298223f31a68d9f79e267654dc35eba58cb95 --- rally/plugins/openstack/context/keystone/users.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rally/plugins/openstack/context/keystone/users.py b/rally/plugins/openstack/context/keystone/users.py index 5e20156c..71ed8c8c 100644 --- a/rally/plugins/openstack/context/keystone/users.py +++ b/rally/plugins/openstack/context/keystone/users.py @@ -143,14 +143,18 @@ class UserGenerator(UserContextMixin, context.Context): "users_per_tenant": 1, "resource_management_workers": cfg.CONF.users_context.resource_management_workers, - "project_domain": cfg.CONF.users_context.project_domain, - "user_domain": cfg.CONF.users_context.user_domain, "user_choice_method": "random", } def __init__(self, context): + self.credential = context["admin"]["credential"] + project_domain = (self.credential.project_domain_name or + cfg.CONF.users_context.project_domain) + user_domain = (self.credential.user_domain_name or + cfg.CONF.users_context.user_domain) + self.DEFAULT_CONFIG["project_domain"] = project_domain + self.DEFAULT_CONFIG["user_domain"] = user_domain super(UserGenerator, self).__init__(context) - self.credential = self.context["admin"]["credential"] def _remove_default_security_group(self): """Delete default security group for tenants."""