Code question on domain config reloads

asked 2015-03-30 15:25:23 -0500

pentatonic gravatar image

I have been looking at the latest code from master (Kilo 2 be), to understand how the domain configs are being loaded from the database, with the new APIs in identity 3.4: ( )

I see where, in keystone/keystone/identity/, the domain_configured wrapper makes sure that domain configs and drivers have been loaded.

But how does the system know to re-load modified configs:

def domains_configured(f):
"""Wraps API calls to lazy load domain configs after init.

This is required since the assignment manager needs to be initialized
before this manager, and yet this manager's init wants to be
able to make assignment calls (to build the domain configs).  So
instead, we check if the domains have been initialized on entry
to each call, and if requires load them,

def wrapper(self, *args, **kwargs):
    if (not self.domain_configs.configured and
            self.driver, self.resource_api)
    return f(self, *args, **kwargs)
return wrapper

In particular, the line " if (not self.domain_configs.configured ". The configured flag is set to True and remains that way. So I'm not understanding how configs get reloaded when say someone changes an option for that config.

I saw that resource/ uses MEMOIZE and I'm sure there is some cache invalidation that happens (get_config_with_sensitive_info calls invalidate), but I'm having trouble finding the exact piece of code that would illustrate how the new config gets accounted for since the wrapper above seems like it will not reload anything because of the configure flag being set to True already.

edit retag flag offensive close merge delete