'Query templates from the cache. Fallback to canonical identifier for auto-config.'

def read_config_from_store(self, identifier):

    try:
        res = self.template_cache.get_templates(identifier)
        if (not res):
            log.debug('No    template    found    for    {},    trying    with    auto-config...'.format(identifier))
            image_ident = self._get_image_ident(identifier)
            res = self.template_cache.get_templates(image_ident)
            if (not res):
                return []
    except Exception as ex:
        log.debug('No    config    template    found    for    {0}.    Error:    {1}'.format(identifier, str(ex)))
        return []
    return res
