summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-06-18 17:32:03 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-06-18 17:32:03 -0700
commitb84432fdd390e3bd239dda997e6fa8fad086e2bd (patch)
tree73358927f48eaabe75d1b232460f8677c479d0de /cloudinit
parent103e5fe784007a2ee3855031fd55d2470fa0d19c (diff)
downloadvyos-cloud-init-b84432fdd390e3bd239dda997e6fa8fad086e2bd.tar.gz
vyos-cloud-init-b84432fdd390e3bd239dda997e6fa8fad086e2bd.zip
1. Revert the 'transform-' template back to 'config-' template for now.
2. Make the init class have a public 'read_cfg' which can be used to force cfg loading to occur (instead of having to go through the cfg property) a. This is a more 'public' way of forcing config to load, without exposing the config itself.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/stages.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index ba6cb915..a713bd1f 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -89,10 +89,8 @@ class Init(object):
return self._extract_cfg('restricted')
def _extract_cfg(self, restriction):
- # None check so that we don't keep on re-loading if empty
- if self._cfg is None:
- self._cfg = self._read_cfg()
- LOG.debug("Loaded init config %s", self._cfg)
+ # Ensure actually read
+ self.read_cfg()
# Nobody gets the real config
ocfg = copy.deepcopy(self._cfg)
if restriction == 'restricted':
@@ -154,6 +152,12 @@ class Init(object):
g = None
util.chownbyname(log_file, u, g)
+ def read_cfg(self):
+ # None check so that we don't keep on re-loading if empty
+ if self._cfg is None:
+ self._cfg = self._read_cfg()
+ LOG.debug("Loaded init config %s", self._cfg)
+
def _read_cfg(self):
b_config = util.get_builtin_cfg()
try:
@@ -488,7 +492,7 @@ class Transforms(object):
func_args = [name, copy.deepcopy(self.cfg),
c_cloud, transforms.LOG, args]
# This name will affect the semaphore name created
- run_name = "transform-%s" % (name)
+ run_name = "config-%s" % (name)
c_cloud.run(run_name, mod.handle, func_args, freq=freq)
except Exception as e:
util.logexc(LOG, "Running %s (%s) failed", name, mod)