summaryrefslogtreecommitdiff
path: root/bin
AgeCommit message (Collapse)Author
2016-04-15log that you're not applying configScott Moser
2016-04-15only apply networking once per instanceScott Moser
This attempts to only apply the networking once per instance by doing so only if the datasource was restored from disk. This will work by default for datasources with a functioning check_instance_id or if the user has set manual_cache_clean to true.
2016-03-29apply_network_config improvementsScott Moser
3 things here: a.) do not raise exception, only warn when trying to apply a network config for a distro that does not have an implementation. This is important since debian/ubuntu is the only one *with* an implementation at the moment b.) apply network config in 'cloud-init --local' even if there is no datasource found. c.) do not write 70-persistent-net.rules the code was writing both 70-persistent-net.rules and /etc/systemd/network/50-cloud-init-*.link files that would just be confusing.
2016-03-23trust existing datasource in modules or singleScott Moser
This fixes a bug where modules mode was not passing a 'existing' flag to fetch. fetch had existing default to 'check'. The DataSourceNoCloud when fed with data from a disk will return False to check() as it is not a guarantee'd hit. That caused fetch to go looking for a new datasource. That would have actually worked, but modules and single create the Init with deps=[]. So it went looking for Datasources that matched those deps, and only found DataSourceNone. I'm going to keep having modules and single specify deps=[] as that will prevent them from going to look for a DS and further making things worse.
2016-03-22add code to invoke networking configScott Moser
there is no data source that has a populated network_config() so at this point this doesn't do anything.
2016-03-21merge from trunkScott Moser
2016-03-21quickly check to see if the previous instance id is still validScott Moser
This adds a check in cloud-init to see if the existing (cached) datasource is still valid. It relies on support from the Datasource to implement 'check_instance_id'. That method should quickly determine (if possible) if the instance id found in the datasource is still valid. This means that we can still notice new instance ids without depending on a network datasource on every boot. I've also implemented check_instance_id for the superclass and for 3 classes: DataSourceAzure (check dmi data) DataSourceOpenstack (check dmi data) DataSourceNocloud (check the seeded data or kernel command line) LP: #1553815
2016-03-20fix syntaxScott Moser
2016-03-18add atomic_write_file and use it from atomic_write_jsonScott Moser
atomic_write_file just does less and easily utilized for the same purpose that atomic_write_json served.
2016-03-03Update pep8 runner and fix pep8 issuesRyan Harper
2015-09-03reporting/events: catch a final remaining incorrect use of 'reporting'Scott Moser
2015-08-07add doc, remove some debug / print statements.Scott Moser
2015-08-06add the webhook handlerScott Moser
2015-08-06tests passScott Moser
2015-08-04fix pep8Scott 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
2015-07-31init single: hook up reporterScott Moser
2015-07-31address Daniel's comments in reviewScott Moser
2015-07-31fix issues found when testingScott Moser
2015-07-30fix arg orderingScott Moser
2015-07-30fix call to print_excScott Moser
2015-07-30fix namespace / local variable collisionScott Moser
2015-07-30tests passScott Moser
2015-05-01Fix exception when running with no arguments on Python 3Scott Moser
LP: #1424277
2015-02-26status_wrapper: do not swallow errorsScott Moser
2015-02-26Fix traceback with no arguments on Python 3.Daniel Watkins
Fixes bug 1424277.
2015-02-10use encode_textScott Moser
2015-02-10fix for cloud-init bin use encodeScott Moser
2014-08-13remove un-used 'end' in result.json and status.jsonScott Moser
2014-07-15Add more useful execution continuing messageJoshua Harlow
2014-03-03version space (v1:) result_path json alsoScott Moser
2014-02-25be atomic when writing status filesScott Moser
2014-02-24fix write_json callScott Moser
2014-02-24minor cleanupsScott Moser
2014-02-24fixes from testing, force symlinkScott Moser
2014-02-24possibly functional start testingScott Moser
2014-02-20initial commit for statusScott Moser
2014-01-08Significant re-working of the userdata handling and introduction ofBen Howard
vendordata. Vendordata is a datasource provided userdata-like blob that is parsed similiarly to userdata, execept at the user's pleasure. cloudinit/config/cc_scripts_vendor.py: added vendor script cloud config cloudinit/config/cc_vendor_scripts_per_boot.py: added vendor per boot cloud config cloudinit/config/cc_vendor_scripts_per_instance.py: added vendor per instance vendor cloud config cloudinit/config/cc_vendor_scripts_per_once.py: added per once vendor cloud config script doc/examples/cloud-config-vendor-data.txt: documentation of vendor-data examples doc/vendordata.txt: documentation of vendordata for vendors (RENAMED) tests/unittests/test_userdata.py => tests/unittests/test_userdata.py TO: tests/unittests/test_userdata.py => tests/unittests/test_data.py: userdata test cases are not expanded to confirm superiority over vendor data. bin/cloud-init: change instances of 'consume_userdata' to 'consume_data' cloudinit/handlers/cloud_config.py: Added vendor script handling to default cloud-config modules cloudinit/handlers/shell_script.py: Added ability to change the path key to support vendor provided 'vendor-scripts'. Defaults to 'script'. cloudinit/helpers.py: - Changed ConfigMerger to include handling of vendordata. - Changed helpers to include paths for vendordata. cloudinit/sources/__init__.py: Added functions for helping vendordata - get_vendordata_raw(): returns vendordata unprocessed - get_vendordata(): returns vendordata through userdata processor - has_vendordata(): indicator if vendordata is present - consume_vendordata(): datasource directive for indicating explict user approval of vendordata consumption. Defaults to 'false' cloudinit/stages.py: Re-jiggered for handling of vendordata - _initial_subdirs(): added vendor script definition - update(): added self._store_vendordata() - [ADDED] _store_vendordata(): store vendordata - _get_default_handlers(): modified to allow for filtering which handlers will run against vendordata - [ADDED] _do_handlers(): moved logic from consume_userdata to _do_handlers(). This allows _consume_vendordata() and _consume_userdata() to use the same code path. - [RENAMED] consume_userdata() to _consume_userdata() - [ADDED] _consume_vendordata() for handling vendordata - run after userdata to get user cloud-config - uses ConfigMerger to get the configuration from the instance perspective about whether or not to use vendordata - [ADDED] consume_data() to call _consume_{user,vendor}data cloudinit/util.py: - [ADDED] get_nested_option_as_list() used by cc_vendor* for getting a nested value from a dict and returned as a list - runparts(): added 'exe_prefix' for running exe with a prefix, used by cc_vendor* config/cloud.cfg: Added vendor script execution as default tests/unittests/test_runs/test_merge_run.py: changed consume_userdata() to consume_data() tests/unittests/test_runs/test_simple_run.py: changed consume_userdata() to consume_data()
2013-07-30set reading /proc/uptime to false by default.Scott Moser
reading /proc/uptime is going to be slower, and no reason to do it on most things. Better to only do it when you suspect maybe a need for it.
2013-07-30add util.log_time helperScott Moser
The reason for this is that more and more things I was wanting to be able to see how long they took. This puts that time logic into a single place. It also supports (by default) reading from /proc/uptime as the timing mechanism. While that is almost certainly slower than time.time(), it does give millisecond granularity and is not affected by 'ntpdate' having run in between the two events.
2012-09-19if a logged message fails, fallback to logging to stdoutJoshua Harlow
This most commonly occurs if a user-data script does '/sbin/poweroff' where syslog was being used. Once poweroff is invoked, syslog gets killed and logging would start to show stack traces. This generally tries to continue working instead, but log to stderr.
2012-09-19First thing that we do after we can start importingJoshua Harlow
is to patch the functionality before it gets reimported.
2012-09-06Add capturing of basic signal handlers toJoshua Harlow
handle those signals more gracefully and with better messaging than what comes builtin.
2012-08-09Move the code that did the 'cloud-config' upstart event name emitting to Joshua Harlow
a config module and make it more generic in that it can take in a list of event names to emit as arguments. Add a yaml example to replace the functionality removed from the main binary.
2012-07-26emit the cloud-config event againScott Moser
The merge of 0.7.0 dropped the cloud-config initctl emission. I've added it back here, but done so in a way that doesn't force non-ubuntu (or non-upstart) distros to provide this config setting to disable it. LP: #1028674
2012-07-10Change the welcome message to be slightly differentJoshua Harlow
when running in local mode vs non-local mode, which is useful when tracking what is happening in the console and in the logs that are written out later.
2012-07-10re-setup logging to address cloud-config changes input via user-dataScott Moser
If the user has input logging information in user-data cloud-config we want to set up the logging to accept that after the data source has been read.
2012-07-10send welcome message after logging has been appliedScott Moser
in the 'cloud-init init' stages, we want the welcome message to get to the correct output as specified by the system's configuration. Ie, if the local /etc/cloud.config.d had 'output' or 'log_cfg' settings we want those to be able to affect the welcome message also. In normal operation, nothing else will go to stdout or stderr before this, and likely/hopefully nothing terribly important to the logs.
2012-07-09cloud-init: do not warn on failure to find local datasourceScott Moser
Instead of a warning, only debug this message. Warnings get to console and look scary to users.