~smoser/cloud-init/trunk.transfer-ds

« back to all changes in this revision

Viewing changes to cloudinit/sources/__init__.py

  • Committer: Scott Moser
  • Date: 2016-03-22 08:08:51 UTC
  • Revision ID: smoser@ubuntu.com-20160322080851-3hiise035rniilq2
commit data source transfer stuff

the goal here is to make a v2 datasources that are mroe aware of
network_config and can return a 'transfer' mode, taht basically
says "Yes,  I'm the datasource you're looking for, but I need some network".

I walked through the DS and looked which ones could benefit from this.
The first ones to look at would be:
ConfigDrive: claim, hostname, network
NoCloud    : claim, hostname, network
MAAS       : claim, network (disabled)
Azure      : claim, hostname

                  definitive hostname   network
== Pure Local ==
ConfigDrive:        YES       yes        yes
CloudSigma:         YES       yes        no
NoCloud             YES       yes        yes
OpenNebula          Weak      yes        yes
OVF                 Weak      yes        yes
SmartOS             YES       yes        no
AltCloud            YES       no         no

== Hybrid ==
Azure:              YES       yes        no
BigStep:            YES       no         could[partner mod]

== Pure Network ==
CloudStack:         NO        no         no
Ec2                 NO        no         yes[network]
GCE                 NO        no         no?
MAAS                YES       no         no
OpenStack           NO        no         no
DigitalOcean        NO        no         no

Show diffs side-by-side

added added

removed removed

Lines of Context:
290
290
    for ds_name in cfg_list:
291
291
        if not ds_name.startswith(DS_PREFIX):
292
292
            ds_name = '%s%s' % (DS_PREFIX, ds_name)
 
293
 
 
294
        # Here instad of finding 'get_datasoure_list', add a search
 
295
        # for get_datasource_list_v2.  It still gets called with the deps.
 
296
        # but mostly only so it can decide if it is a transfer or not.
293
297
        m_locs, _looked_locs = importer.find_module(ds_name,
294
298
                                                    pkg_list,
295
299
                                                    ['get_datasource_list'])