summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-11 18:02:32 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-11 18:02:32 -0700
commitdab0b7c7ebcc92c772bfadce334ba118955f5a59 (patch)
treefacfa8da37af22ffe64f264a322490849484efcd
parent00399cd672e14b7e6953954eaf126f0ccfe35ecd (diff)
downloadvyos-cloud-init-dab0b7c7ebcc92c772bfadce334ba118955f5a59.tar.gz
vyos-cloud-init-dab0b7c7ebcc92c772bfadce334ba118955f5a59.zip
Fix logging + fetch user data before user data content handlers are activated.
-rw-r--r--cloudinit/stages.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 55ad143d..2cb9d0ec 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -124,7 +124,6 @@ class Init(object):
util.chownbyname(log_file, u, g)
def _read_cfg(self):
- # Deep copy so that
b_config = util.get_builtin_cfg()
try:
conf = util.get_base_cfg()
@@ -279,8 +278,10 @@ class Init(object):
data = cloud.Cloud(self.datasource,
self.paths, copy.deepcopy(self.cfg))
- # Init the handlers first
# Ensure userdata fetched before activation
+ ud_obj = data.get_userdata()
+
+ # Init the handlers first
called = []
for (_mtype, mod) in c_handlers.iteritems():
if mod in called:
@@ -294,9 +295,12 @@ class Init(object):
'handlerdir': idir,
'data': data,
'frequency': frequency,
+ # This will be used when new handlers are found
+ # to help write there contents to files with numbered
+ # names...
'handlercount': 0,
}
- ud.walk(data.get_userdata(), ud.walker_callback, data=part_data)
+ ud.walk(ud_obj, ud.walker_callback, data=part_data)
# Give callbacks opportunity to finalize
called = []