summaryrefslogtreecommitdiff
path: root/cloudinit
AgeCommit message (Collapse)Author
2012-08-10Adjustments so that the default old event is used whenJoshua Harlow
no args are provided. Adjust the config file to use this older method so that older changes aren't needed. Also when calling 'initctl' emit fails log the exception message so that some useful warning information can be produced.
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-08-08Address review feedback for:Joe VLcek
https://code.launchpad.net/~joev-n/cloud-init/altcloud-changes/+merge/116542
2012-08-06add protection against dns-redirection to is_resolvableScott Moser
In an effort to make the EC2 Datasource's search under ec2.archive.ubuntu.com resilient against dns redirection, we add some code to is_resolvable. One future enhancement for this would be to protect against server side round robin results. Ie, if 'bogus-entry' returned 10.0.1.1 one time, and then 10.0.1.2 a second time. We could check if results where within the same 3 octets, and assume invalid if they were.
2012-08-06re-add the 'main' routine to DataSourceMAAS.pyScott Moser
the main function, which was usable for debugging maas was dropped during the rework branch. I'm adding it back here as it is very useful. It is possibly better implemented some other way than this, but this is good enough.
2012-08-03use get_cfg_option_bool for apt_mirror_search_dnsScott Moser
2012-08-03do not search for mirror named '<distro>-mirror' in dns by defaultScott Moser
As described in the bug, enough non-cloud users experienced issues with cloud-init selecting a mirror due to consumer level network providers using dns server redirection. We're turning this off by default. LP: #974509
2012-07-23pep8, pylint... AltCloud source changesJoe VLcek
2012-07-20Add retry logic to DataSourceAltCloudJoe VLcek
2012-07-17Added RHEVm and vSphere support as source AltCloudJoe VLcek
2012-07-16improve debug via _CLOUD_INIT_SAVE_STDIN and _CLOUD_INIT_SAVE_STDOUTScott Moser
This does 2 things: a.) fixes broken logic in 'close_stdin' previously _CLOUD_INIT_SAVE_STDIN had to be set to false to preserve stdin. "save_stdin" should be true to indicate it should be saved. The net result is that you can stuff just add import pdb; pdb.set_trace() to code, and then run something like: sudo _CLOUD_INIT_SAVE_STDIN=1 _CLOUD_INIT_SAVE_STDOUT=1 \ cloud-init single --name=mounts --frequency=always And enter the debugger even if you had a 'output' that would redirect stdin/out by default, like: output: {all: '| tee -a /var/log/cloud-init-output.log'}
2012-07-16DataSourceEc2: fix bad usage of log that caused traceScott Moser
2012-07-12walker_callback: fix traceback on empty payload.Scott Moser
A previous commit of mine here tried to apply a trivial fix to avoid a warning on empty content type. Instead, it made the empty content type call a handler which did not exist. This instead logs warning on unknown non-empty payload. It logs debug on empty payload.
2012-07-12load_yaml: if conversion fails, but string is empty, return defaultScott Moser
the problem sovled here is that most callers of yaml_load do not pass 'None' as a allowed type. I didn't want to change all the callers. If the yaml.safe_load ended up being None we were raising a TypeError and that was getting logged (meaning output to console). Even though the this was not really bad. So, if the type is not in the list, *and* it is not empty, then log exception. If it in the list and empty, just debug. empty input was occurring when cloud-config was empty (no user-data)
2012-07-12DataSourceOVF: again fix broken commitScott Moser
2012-07-12fix bad variable. should be 'LOG', not 'log'Scott Moser
2012-07-12DataSourceOVF: do not log exception on failed mountScott Moser
during datasourceovf looking for a transport, the failed mounts were having exceptions logged (triggering an unneccessary warning also)
2012-07-11do not capture runparts outputScott Moser
runparts output was being captured. This meant that output of user-scripts was being captured and not sent to stdout (console).
2012-07-11add write-files module for "injecting" files (LP: #1012854)Scott Moser
This implements file writing via cloud-config. It also * adjusts other code to have user/group parsing in util instead of in stages.py, * renames decomp_str to decomp_gzip since it is more meaningful when named that (as thats all it can decompress). LP: #1012854
2012-07-11Update the write files with the new content/compression handling.Joshua Harlow
Adjust the examples file to reflect this.
2012-07-11Fix log message after 'write_files' key change.Joshua Harlow
2012-07-11Adjust the decoding of the files that are given so that a canonicalizeJoshua Harlow
happens first, which will examine the incoming encoding, and decide the neccasary decoding types needed to get the final resultant string and then use these normalized decoding types to actually do the final decode. Also change the name of the config key that is looked up to 'write_files' since 'files' is pretty generic and could have clashes with other modules. Add an example that shows how to use this in the different encoding formats that are supported.
2012-07-10Fixes 1012854 by implementing file writing, adjustsJoshua Harlow
other code to have user/group parsing in util instead of in stages.py, renames decomp_str to decomp_gzip since it is more meaningful when named that (as thats all it can decompress).
2012-07-10Remove the usage of set,list,dict and use the collectionsJoshua Harlow
iterable which performs the same, but can handle iterator types beyond those three.
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-10fix regression in logging codeScott Moser
revno 584 broke logging. This fixes as it intended.
2012-07-10cc_resizefs: show more specific time.Scott Moser
Show 3 decimal places for how long a resize took. 1 second granularity was too large.
2012-07-09Use the common 'is_false' routine for testing false here insteadharlowja
of a custom list that may confuse people trying to use this.
2012-07-09Return a more useful name for the file lock (which shows what file is being ↵Joshua Harlow
locked).
2012-07-09Add more information about why we are returning early andJoshua Harlow
why we don't convert a string that is a filename to a string buffer/io like object.
2012-07-09do not warn to stderr if one of the logging configs works.Scott Moser
In 0.6.3, if one of the logging configs succeeded, then it was just used. If it failed, it failed silently. This behavior was expected, and desired. As the code was here, we tried each log_cfg in the list anyway (possibly using the last rather than the first) and writing a messgae including 'WARN' to stderr on failure of the log.
2012-07-09cc_final_message: fix pylint issueScott Moser
2012-07-09url_helper.py, cc_rightscale_userdata.py: reduce WARN to DEBUGScott Moser
cc_rightscale_userdata.py is likely to not be found, so its WARN was annoying in that it got to console output. The same is true of url_helper. Not all uses of readurl were fatal or justified to warn if the content was not there.
2012-07-09Revert back to using cheetah + adjust resultant code + templatesJoshua Harlow
At this point there is a mixture of "double hash" cheetah comments and '#*' cheetah comments.
2012-07-09Update chownbyname to catch the key error when users/groups that are not knownJoshua Harlow
are provided and rethrow it as a OSError (which seems reasonable) and adjust its usage in the log file touching/permission modification stage to catch this error and log it.
2012-07-09fix 'make pylint' warningsScott Moser
On my system (quantal) this 'make pylint' does not complain now.
2012-07-09DataSourceEc2: only do dns check in mirror selectionScott Moser
This returns the check for an archive mirror in the DataSourceEc2 to only do so by DNS resolution. The 'rework' branch had made the check wait and timeout on attempts to reach the mirror. This resulted in 120 seconds of waiting before failure. For now, just go back to the old situation of checking by dns.
2012-07-06Updated so that if no mirror is found, the module stops running.Joshua Harlow
2012-07-03Add a check on 'chownbyname' that catches the keyerror and logs it (instead ↵Joshua Harlow
of failing)
2012-07-021. Move the welcome message template string to a constant at the top of the ↵Joshua Harlow
module 2. Fix the usage of multi_log to log to only one of the places (for now) 3. Update comment about multi-log and why write_file isn't used in this case
2012-07-01Merge in pending changes.harlowja
2012-07-01Always read fro the cloud config location + conf.d locationsharlowja
2012-07-011. Rename util functions to is_true and is_falseharlowja
2. Move the config loading functions to where they are used (in stages) 3. Adjust cc_set_passwords to use the is_true and is_false renamed functions 4. Adjust the init stage to have a _read_base_config function used to load the base 'initial' configuration from the following locations a. Kernel cmdline b. Conf.d location (+ the cloud.cfg location) c. Built-in configuration
2012-07-01Add a multi log function that can write to stderr, console and a log debug, ↵Joshua Harlow
useful in certain cases
2012-06-29Include the helpers import.harlowja
2012-06-29Refactor the selinux guard to aid in mockingharlowja
1. Adjust the test_util after this mocking to be cleaner
2012-06-29add update_package_sources to distro classScott Moser
Previously update_package_sources was a private class (_update_package_sources). The apt_update_upgrade class called it. It does make sense that things would want to call this independently of installing packages. Therefore, expose it as a non hidden method.
2012-06-29Remove logging of module/init configsJoshua Harlow
2012-06-29Just log the number of commands 'shellified'Joshua Harlow
2012-06-29Don't remove the key if its not there (or was already removed)Joshua Harlow