set permissive to cfgimpl_get_home_by_path
authorEmmanuel Garette <egarette@cadoles.com>
Thu, 4 Apr 2013 10:16:18 +0000 (12:16 +0200)
committerEmmanuel Garette <egarette@cadoles.com>
Thu, 4 Apr 2013 10:16:18 +0000 (12:16 +0200)
tiramisu/config.py

index eca1751..f42dfb2 100644 (file)
@@ -116,8 +116,11 @@ class SubConfig(object):
         # attribute access by passing a path,
         # for instance getattr(self, "creole.general.family.adresse_ip_eth0")
         if '.' in name:
-            homeconfig, name = self.cfgimpl_get_home_by_path(name)
-            return homeconfig._getattr(name)
+            homeconfig, name = self.cfgimpl_get_home_by_path(name,
+                    force_permissive=force_permissive,
+                    force_properties=force_properties)
+            return homeconfig._getattr(name, force_permissive=force_permissive,
+                                       force_properties=force_properties)
         opt_or_descr = getattr(self._cfgimpl_descr, name)
         # symlink options
         if type(opt_or_descr) == SymLinkOption:
@@ -147,11 +150,13 @@ class SubConfig(object):
         child = getattr(self._cfgimpl_descr, name)
         child.setoption(self, value)
 
-    def cfgimpl_get_home_by_path(self, path):
+    def cfgimpl_get_home_by_path(self, path, force_permissive=False, force_properties=None):
         """:returns: tuple (config, name)"""
         path = path.split('.')
         for step in path[:-1]:
-            self = getattr(self, step)
+            self = self._getattr(step,
+                force_permissive=force_permissive,
+                force_properties=force_properties)
         return self, path[-1]
 
     def _cfgimpl_get_path(self):