From b84432fdd390e3bd239dda997e6fa8fad086e2bd Mon Sep 17 00:00:00 2001
From: Joshua Harlow <harlowja@yahoo-inc.com>
Date: Mon, 18 Jun 2012 17:32:03 -0700
Subject: 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.

---
 cloudinit/stages.py | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

(limited to 'cloudinit')

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)
-- 
cgit v1.2.3