Comment 1 for bug 1648380

Revision history for this message
Louis Bouchard (louis) wrote :

Here is what I have found :
This seems suspect to me :

Nov 21 10:12:33 ubuntu [CLOUDINIT] __init__.py[DEBUG]: Looking for for data source in: ['CloudSigma'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM']
Nov 21 10:12:33 ubuntu [CLOUDINIT] __init__.py[DEBUG]: Searching for local data source in: []

There is no local data source returned and this is what will later trigger the python backtrace.

The message "Looking for for data source in" comes from list_sources().

list_sources(cfg_list, depends, pkg_list)
cfg_list = ['CloudSigma']
depends = ['FILESYSTEM']

Down in list_source we have :
        for m_loc in m_locs:
     mod = importer.import_module(m_loc)
            lister = getattr(mod, "get_datasource_list")
            matches = lister(depends)
            if matches:
                break
    return src_list

lister is defined as get_datasource_list(depends) that does
    return sources.list_from_depends(depends, datasources)

list_from_depends() does :
def list_from_depends(depends, ds_list):
    ret_list = []
    depset = set(depends)
    for (cls, deps) in ds_list:
        if depset == set(deps):
     ret_list.append(cls)
    return ret_list

ds_list being datasources which is :
datasources = [
    (DataSourceCloudSigma, (sources.DEP_FILESYSTEM)),
]
and sources.DEP_FILESYSTEM == 'FILESYSTEM'

depset will be :
depset = {'FILESYSTEM'}

deps being sources.DEP_FILESYSTEM, so = 'FILESYSTEM'
set(deps) = {'I', 'Y', 'M', 'T', 'L', 'S', 'F', 'E'} !!!

so if depset == set(deps): is false, hence returns nothing.

Now I don't yet know what changed that makes that test fail