From 9006dca09f24ea3da44cf490c63e98716d658b28 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 4 Apr 2013 12:16:18 +0200 Subject: [PATCH] set permissive to cfgimpl_get_home_by_path --- tiramisu/config.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tiramisu/config.py b/tiramisu/config.py index eca1751..f42dfb2 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -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):