summaryrefslogtreecommitdiff
path: root/cloudinit/cloud.py
AgeCommit message (Collapse)Author
2018-08-24logging: Add logging config type hyperv for reporting via Azure KVPAndy Liu
Linux guests can provide information to Hyper-V hosts via KVP. KVP allows the guests to provide any string key-value-pairs back to the host's registry. On linux, kvp communication pools are presented as pool files in /var/lib/hyperv/.kvp_pool_#. The following reporting configuration can enable this kvp reporting in addition to default logging if the pool files exist: reporting:     logging:         type: log     telemetry:         type: hyperv
2018-03-14set_hostname: When present in metadata, set it before network bringup.Chad Smith
When instance meta-data provides hostname information, run cc_set_hostname in the init-local or init-net stage before network comes up. Prevent an initial DHCP request which leaks the stock cloud-image default hostname before the meta-data provided hostname was processed. A leaked cloud-image hostname adversely affects Dynamic DNS which would reallocate 'ubuntu' hostname in DNS to every instance brought up by cloud-init. These instances would only update DNS to the cloud-init configured hostname upon DHCP lease renewal. This branch extends the get_hostname methods in datasource, cloud and util to limit results to metadata_only to avoid extra cost of querying the distro for hostname information if metadata does not provide that information. LP: #1746455
2017-11-10Improve warning message when a template is not found.Robert Schweikert
At present the location for the template file look up upon failure includes the template file itself. However based on the wording of the message it should only contain the template directory issue LP: #1731035
2017-04-21pylint: fix all logging warningsJoshua Powers
This will change all instances of LOG.warn to LOG.warning as warn is now a deprecated method. It will also make sure any logging uses lazy logging by passing string format arguments as function parameters.
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2015-08-31split 'events' portion of reporting into separate fileScott Moser
this just separates events from other things that could conceivably be reported.
2015-08-04fix lack of import in cloud.pyScott Moser
2015-08-02fix tests from syncScott Moser
change ReportStack to ReportEventStack change default ReportEventStack to be status.SUCCESS instead of None
2015-07-31plumb the rest the reporting throughScott Moser
2012-08-27Update so that the content types searched for launch-indexJoshua Harlow
variable has a little more meaning and by default look in metadata for 'launch-index' and have ec2 instead look for a different variable (thus allowing more datasources to just work).
2012-08-26Add the capability to understand and filter onJoshua Harlow
userdata based on a launch-index (or leave userdata alone if none is provided by the datasource). This works by doing the following. 1. Adjusting the userdata processor to attempt to inject a "Launch-Index" header into the messages headers (by either taking a header that already exists or by looking into the payload to see if it exists there). 2. Adjust the get_userdata ds function to apply a filter on the returned userdata (defaulting to false) that will now use the datasources get_launch_index value to restrict the 'final' message used in consuming user data (the same behavior if not existent). 3. Further down the line processes that use the 'resultant' userdata now will only see the ones for there own launch index (ie cloud-config will be restricted automatically and so on) and are unaffected (although they can now ask the cloud object or the datasource for its launch index via the above new ds method.
2012-08-22rework package mirror selectionScott Moser
There are several changes here. * Datasource now has a 'availability_zone' getter. * get_package_mirror_info * Datasource convenience 'get_package_mirror_info' that calls the configured distro, and passes it the availability-zone * distro has a get_package_mirror_info method * get_package_mirror_info returns a dict that of name:mirror this is to facilitate use of 'security' and 'primary' archive. * this supports searching based on templates. Any template that references undefined values is skipped. These templates can contain 'availability_zone' (LP: #1037727) * distro's mirrors can be arch specific (LP: #1028501) * rename_apt_lists supports the "mirror_info" rather than single mirror * generate_sources_list supports mirror_info, and as a result, the ubuntu mirrors reference '$security' rather than security (LP: #1006963) * remove the DataSourceEc2 specific mirror selection, but instead rely on the above filtering, and the fact that 'ec2_region' is only defined if the availability_zone looks like a ec2 az.
2012-06-211. Renames for debug message from 'transform' to 'module'harlowja
2. Fixing up more cloud.path.joins found to use the right ro/rw filename
2012-06-20Massive pylint + pep8 fixups!Joshua Harlow
2012-06-18When logging is 'cycled' ensure that we call the logging reset routine first.Joshua Harlow
2012-06-16Add comment as to why the cloud object/wrapper is usefulJoshua Harlow
2012-06-15Fixups to ensure that pylint does not find anything major wrong.Joshua Harlow
2012-06-15Instead of having the cloud pass large references to its constructor, this ↵Joshua Harlow
has been reduced to actual objects. Added a get template filename helper which can be used to locate template files for various handlers/transforms. Ensured that the config that we give back out is copied, so that it can't be modified by any 'malicous' handlers/transforms. Added helper method cycle_logging that can resetup logging, this is mainly used by the rsyslog transform.
2012-06-11This will now just contain the "public" view of the cloud objects, backed by ↵Joshua Harlow
whatever other set of objects.
2012-06-09More init fs here, cleanup after user_data file moves + other cleanups.Joshua Harlow
2012-06-08Move to having a parts directory/module + seperate modules.Joshua Harlow
2012-06-08Fixup CloudConfig by using new module functions and calling objects.Joshua Harlow
2012-06-08This now holds the following classes:Joshua Harlow
CloudInit - cut up to only provide some basic init processes CloudPartData - provided to handlers so that they can fetch needed data without providing the whole enchilda of cloud init. CloudPaths - holds the paths that should be used, for instances, for non-instances and such. CloudSemaphores - holds the concept of cloud inits sempaphores, but cleaned up, using context manager to help here. CloudHandlers - holds the user data handlers to be activated CloudConfig - the cloud config object (to be cleaned up)
2012-06-07Add this file which will contain the cloud init and cloud config classes.Joshua Harlow