'Loads all settings from other template(s) specified by a section\'s
\'extends\' setting.
This method walks a dependency tree of sections from bottom up. Each
step is a group of settings for a section in the form of a dictionary.
A \'master\' dictionary is updated with the settings at each step. This
causes the next group of settings to override the previous, and so on.
The \'section_name\' settings are at the top of the dependency tree.'

def _load_extends_settings(self, section_name, store):

    section = store[section_name]
    extends = section.get('extends')
    if (extends is None):
        return
    if DEBUG_CONFIG:
        log.debug(('%s    extends    %s' % (section_name, extends)))
    extensions = [section]
    while (extends is not None):
        try:
            section = store[extends]
            if (section in extensions):
                exts = ',    '.join([self._get_section_name(x['__name__']) for x in extensions])
                raise exception.ConfigError(('Cyclical    dependency    between    sections    %s.    Check    your    EXTENDS    settings.' % exts))
            extensions.insert(0, section)
        except KeyError:
            raise exception.ConfigError(("%s    can't    extend    non-existent    section    %s" % (section_name, extends)))
        extends = section.get('extends')
    transform = AttributeDict()
    for extension in extensions:
        transform.update(extension)
    store[section_name] = transform
