summaryrefslogtreecommitdiff
path: root/cloudinit/DataSource.py
AgeCommit message (Collapse)Author
2012-06-071. Adding some new helper files that split off file inclusion, templating, ↵Joshua Harlow
importing, constant usage. 1. Move all datasources to a new sources directory 1. Rename some files to be more consistent with python file/module naming.
2012-03-19DataSource: if public-keys is a string, split it on newlineScott Moser
Previously, we were returning an array with a single item, which could have contained newlines in it. This does limit the potential content of a ssh public key, but it seems unlikely that in the future a valid public key would contain a newline.
2012-03-01return public-keys as a list if it is a listScott Moser
if public-keys in metadata are a list (rather than a dict), then return them as such. This allows populating NoCloud keys with: public-keys: - ssh-rsa .... myname.mylabel - ssh-dsa .... myname.mylabel2 Or: cat <<EOF public-keys: $(ssh-add -L | sed 's,^\(.*\), - "\1",') EOF
2012-01-18Add HP to Copyright, and Juerg Haefliger Authors.Scott Moser
This copyright change reflects previous changes that Juerg made for pylint and pep8 cleanups. From: Juerg Haefliger <juerg.haefliger@hp.com> Date: Mon, 16 Jan 2012 10:45:12 +0100
2012-01-17[PATCH] PEP8 coding style fixes.Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> This pulls in the named patch for LP: #914739 with a few other changes.
2012-01-17[PATCH 3/4] Fix pylint conventions C0324 (comma not followed by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 2/4] Fix pylint conventions C0322 (operator not preceded by a space)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-17[PATCH 1/4] Fix pylint conventions C0321 (more than one statement on a ↵Scott Moser
single line) From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 11/13] Fix pylint warnings W0141 (used builtin function xyz)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> Replace superseded builtin functions 'filter' and 'map' using list comprehension.
2012-01-12[PATCH 10/13] Fix pylint warnings W0102 (dangerous default value asScott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com> argument)
2012-01-12[PATCH 06/13] Fix pylint warnings W0612 (unused variable)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2012-01-12[PATCH 05/13] Fix pylint warnings W0613 (unused argument)Scott Moser
From: Juerg Haefliger <juerg.haefliger@hp.com>
2011-12-16merge trunkScott Moser
2011-12-16DataSource: fix is_ipv4 usageScott Moser
2011-12-16initial mirror configuration/discoveryScott Moser
2011-12-16move logic of "is this an ipv4 address" to a function is_ipv4Scott Moser
2011-09-22cloudinit/DataSource.py: fix bad usage of get_fqdn_from_hostsScott Moser
2011-09-14try a little harder to get a fqdn rather than defaulting to localdomainScott Moser
This fixes (LP: #850206). See bug for more info. LP: #850206
2011-09-09return a list, not a stringScott Moser
2011-09-09accept that public-keys keys in the metadata service might be a stringScott Moser
LP: #845155
2011-09-01improve DataSource's get_hostname functionScott Moser
This allows for the chance that platform.node returned a fully qualified domainname. Per its doc: Returns the computer's network name (which may not be fully qualified)
2011-08-31cloudinit/DataSource.py: for default instance id, use 'iid-datasource'Scott Moser
Previously the Ubuntu specific and confusing string "ubuntuhost" was used. Use something that gives a better hint as to where it came from for get_instance_id()
2011-07-19improve the updating of /etc/hosts with correct fqdn when possibleScott Moser
Thanks to Adam Gandalman and Marc Cluet for this fix. LP: #812539
2011-02-07add sys_cfg option to DataSource:__init__ , populate ds_cfg from itScott Moser
In order to be able to configure a DataSource via system config (ie, what is in /etc/cloud/cloud.cfg), we pass this into the DataSource class. The DataSource parent class will set up the 'ds_cfg' member based on the subclass name. So, DataSourceEc2 will get: self.ds_cfg = sys_cfg['datasource']['Ec2'] populated for it.
2011-02-04fix logging in DataSource modulesScott Moser
Previous logging was getting 'None' set in the DataSource collections. Thus, 'log.debug' would throw error. I think it is proper to pull in the base cloudinit's log.
2011-01-31replace DataSource's self.logScott Moser
After adding the 'log' element to the DataSource class, pickling would fail with TypeError: can't pickle file objects Instead of having the object with a log reference, use one from 'DataSource.log' and have that set by cloudinit
2011-01-26rework of DataSource loading.Scott Moser
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<item> and, failing that, DataSource<item> 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.
2011-01-25add get_config_obj to a DataSource object.Scott Moser
This will allow for a DataSource to provide its own config that will then be utilized as part of CloudConfig. [to be used in OVF]
2010-08-12initial dump of "sans-cloud" code (DataSourceNoCloud)Scott Moser
The new classes 'DataSourceNoCloud' and 'DataSourceNoCloudNet' implement a way to get data from the filesystem, or (very minimal) data from the kernel command line. This allows the user to seed data to these sources. There are now 2 "cloud-init" jobs, cloud-init-local that runs on mounted MOUNTPOINT=/ and 'cloud-init' that runs on start on (mounted MOUNTPOINT=/ and net-device-up IFACE=eth0 and stopped cloud-init-local ) The idea is that cloud-init-local can actually function without network. The last thing in this commit is "uncloud-init". This tool can be invoked as 'init=/usr/lib/cloud-init/uncloud-init' It will "uncloudify" things in the image, generally making it easier to use for a simpler environment, and then it will exec /sbin/init.
2010-06-15add vi modelines to python filesScott Moser
2010-02-04add copyright informationScott Moser
2010-02-03globally remove ec2init and rename to cloudinitScott Moser