Example #1
0
        def _interpolate(self, section, option, rawval, vars):
            value = ConfigParser._interpolate(self, section, option, eawval, vars)

            return EnvironmentInterpolation().before_get(
                parser=self, section=section, option=option, value=value, 
                defaults=None
            )
Example #2
0
 def _interpolate(self, section, option, rawval, vars):
     try:
         return ConfigParser._interpolate(
             self, section, option, rawval, vars)
     except Exception, e:
         args = list(e.args)
         args[0] = 'Error in file %s, [%s] %s=%r: %s' % (
             self.filename, section, option, rawval, e)
         e.args = tuple(args)
         raise
Example #3
0
 def _interpolate(self, section, option, rawval, vars):
     try:
         return ConfigParser._interpolate(self, section, option, rawval,
                                          vars)
     except Exception, e:
         args = list(e.args)
         args[0] = 'Error in file %s, [%s] %s=%r: %s' % (
             self.filename, section, option, rawval, e)
         e.args = tuple(args)
         raise
Example #4
0
 def _interpolate(self, section, option, value, d):
     try:
         value = ConfigParser._interpolate(self, section, option, value, d)
     except InterpolationError:
         if '%(baseDN)s' in value:
             from mmc.plugins.base import BasePluginConfig
             config = PluginConfigFactory.new(BasePluginConfig, "base")
             value = value.replace('%(baseDN)s', config.baseDN)
         else:
             raise InterpolationError
     return value
Example #5
0
File: config.py Project: allgi/mmc
 def _interpolate(self, section, option, value, d):
     try:
         value = ConfigParser._interpolate(self, section, option, value, d)
     except InterpolationError:
         if '%(baseDN)s' in value:
             from mmc.plugins.base import BasePluginConfig
             config = PluginConfigFactory.new(BasePluginConfig, "base")
             value = value.replace('%(baseDN)s', config.baseDN)
         else:
             raise InterpolationError
     return value
Example #6
0
 def _interpolate(self, section, option, rawval, vars):
     # Python < 3.2
     try:
         return ConfigParser._interpolate(self, section, option, rawval,
                                          vars)
     except Exception:
         e = sys.exc_info()[1]
         args = list(e.args)
         args[0] = 'Error in file %s: %s' % (self.filename, e)
         e.args = tuple(args)
         e.message = args[0]
         raise
Example #7
0
 def _interpolate(self, section, option, rawval, vars):
     # Python < 3.2
     try:
         return ConfigParser._interpolate(
             self, section, option, rawval, vars)
     except Exception:
         e = sys.exc_info()[1]
         args = list(e.args)
         args[0] = 'Error in file %s: %s' % (self.filename, e)
         e.args = tuple(args)
         e.message = args[0]
         raise
Example #8
0
 def _interpolate(self, section, option, rawval, vars):
     value = ConfigParser._interpolate(self, section, option, rawval, vars)
     return EnvironmentInterpolation().before_get(
         parser=self, section=section, option=option,
         value=value, defaults=None,
     )
Example #9
0
 def _interpolate(self, section, option, rawval, variables):
     if isinstance(rawval, basestring):
         oldConfigParser._interpolate(self, section, option, rawval, variables)
     return rawval
Example #10
0
 def _interpolate(self, section, option, rawval, vars):
     try:
         value = ConfigParser._interpolate(self, section, option, rawval, vars)
     except TypeError:
         value = rawval
     return value