diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-07-10 17:48:25 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-07-10 17:48:25 -0400 |
commit | 02fe9d1f85d1194e631c4992495086ce7733f6e1 (patch) | |
tree | 34f7bffca5e6c4393be27980fe65647a788939f2 /bin/cloud-init | |
parent | e119877fcf9c38a89c4a054b146d8189b866d4e8 (diff) | |
download | cloud-init-git-02fe9d1f85d1194e631c4992495086ce7733f6e1.tar.gz |
re-setup logging to address cloud-config changes input via user-data
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.
Diffstat (limited to 'bin/cloud-init')
-rwxr-xr-x | bin/cloud-init | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/cloud-init b/bin/cloud-init index 9dd7296e..fafd176d 100755 --- a/bin/cloud-init +++ b/bin/cloud-init @@ -156,8 +156,8 @@ def main_init(name, args): # 6. Connect to the current instance location + update the cache # 7. Consume the userdata (handlers get activated here) # 8. Construct the modules object - # 9. Adjust any subsequent logging/output redirections using - # the modules objects configuration + # 9. Adjust any subsequent logging/output redirections using the modules + # objects config as it may be different from init object # 10. Run the modules for the 'init' stage # 11. Done! w_msg = welcome_format(name) @@ -268,9 +268,10 @@ def main_init(name, args): except Exception: util.logexc(LOG, "Consuming user data failed!") return 1 - # Stage 8 - TODO - do we really need to re-extract our configs? + + # Stage 8 - re-read and apply relevant cloud-config to include user-data mods = stages.Modules(init, extract_fns(args)) - # Stage 9 - TODO is this really needed?? + # Stage 9 try: outfmt_orig = outfmt errfmt_orig = errfmt @@ -280,6 +281,8 @@ def main_init(name, args): (outfmt, errfmt) = util.fixup_output(mods.cfg, name) except: util.logexc(LOG, "Failed to re-adjust output redirection!") + logging.setupLogging(mods.cfg) + # Stage 10 return run_module_section(mods, name, name) |