From dc5e7116e663d3b5cad165fcac8b3141f8ffbc05 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 26 Jan 2011 18:43:50 +0000 Subject: rework of DataSource loading. The DataSources that are loaded are now controlled entirely via configuration file of 'datasource_list', like: datasource_list: [ "NoCloud", "OVF", "Ec2" ] Each item in that list is a "DataSourceCollection". for each item in the list, cloudinit will attempt to load: cloudinit.DataSource and, failing that, DataSource The module is required to have a method named 'get_datasource_list' in it that takes a single list of "dependencies" and returns a list of python classes inside the collection that can run needing only those dependencies. The dependencies are defines in DataSource.py. Currently: DEP_FILESYSTEM = "FILESYSTEM" DEP_NETWORK = "NETWORK" When 'get_datasource_list' is called for the DataSourceOVF module with [DEP_FILESYSTEM], then DataSourceOVF returns a single item list with a reference to the 'DataSourceOVF' class. When 'get_datasource_list' is called for the DataSourceOVF module with [DEP_FILESYSTEM, DEP_NETWORK], it will return a single item list with a reference to 'DataSourceOVFNet'. cloudinit will then instanciate the class and call its 'get_data' method. if the get_data method returns 'True', then it selects this class as the selected Datasource. --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index aa17a1a6..18934465 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,3 +31,7 @@ via the config file, or user data config file - add support for posting data about the instance to a url (phone_home) - add minimal OVF transport (iso) support + - make DataSources that are attempted dynamic and configurable from + system config. changen "cloud_type: auto" as configuration for this + to 'datasource_list: [ "Ec2" ]'. Each of the items in that list + must be modules that can be loaded by "DataSource" -- cgit v1.2.3