summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-08-06 18:34:57 -0500
committerScott Moser <smoser@ubuntu.com>2015-08-06 18:34:57 -0500
commitebd393e56ba21f8a84571dff499e6d6fb6852042 (patch)
tree8087df81be6a63e0bbc27e19360bda65d59ec9b5 /bin
parent6fdb23b6cbc8de14ebcffc17e9e49342b7bf193d (diff)
downloadvyos-cloud-init-ebd393e56ba21f8a84571dff499e6d6fb6852042.tar.gz
vyos-cloud-init-ebd393e56ba21f8a84571dff499e6d6fb6852042.zip
tests pass
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cloud-init10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/cloud-init b/bin/cloud-init
index 40cdbb06..ad2e624a 100755
--- a/bin/cloud-init
+++ b/bin/cloud-init
@@ -137,6 +137,11 @@ def run_module_section(mods, action_name, section):
return failures
+def apply_reporting_cfg(cfg):
+ reporting.reset_configuration()
+ reporting.update_configuration(cfg.get('reporting'), {})
+
+
def main_init(name, args):
deps = [sources.DEP_FILESYSTEM, sources.DEP_NETWORK]
if args.local:
@@ -191,6 +196,7 @@ def main_init(name, args):
" longer be active shortly"))
logging.resetLogging()
logging.setupLogging(init.cfg)
+ apply_reporting_cfg(init.cfg)
# Any log usage prior to setupLogging above did not have local user log
# config applied. We send the welcome message now, as stderr/out have
@@ -283,6 +289,8 @@ def main_init(name, args):
util.logexc(LOG, "Consuming user data failed!")
return (init.datasource, ["Consuming user data failed!"])
+ apply_reporting_cfg(init.cfg)
+
# Stage 8 - re-read and apply relevant cloud-config to include user-data
mods = stages.Modules(init, extract_fns(args), reporter=args.reporter)
# Stage 9
@@ -343,6 +351,7 @@ def main_modules(action_name, args):
" longer be active shortly"))
logging.resetLogging()
logging.setupLogging(mods.cfg)
+ apply_reporting_cfg(init.cfg)
# now that logging is setup and stdout redirected, send welcome
welcome(name, msg=w_msg)
@@ -405,6 +414,7 @@ def main_single(name, args):
" longer be active shortly"))
logging.resetLogging()
logging.setupLogging(mods.cfg)
+ apply_reporting_cfg(init.cfg)
# now that logging is setup and stdout redirected, send welcome
welcome(name, msg=w_msg)