Example #1
0
 def __init__(self, *args, **kwargs):
     self.async = True
     self.queue = 'default'
     self.timeout = None
     # Assign all the arguments to attributes
     config = config_from_environment('OORQ', **kwargs)
     for arg, value in config.items():
         setattr(self, arg, value)
 def load(self):
     config_file = self.options.get("config_file")
     if not config_file:
         pass
     config = ConfigParser.ConfigParser()
     try:
         config.readfp(open(config_file))
         for (key, value) in config.items("options"):
             if value in ("True", "False"):
                 value = eval(value)
             self.options[key] = value
         for section in config.sections():
             if section != "options":
                 _logger.warning("Only options section is taken into account in upgrades configuration")
     except (IOError, ConfigParser.NoSectionError):
         pass
Example #3
0
 def load(self):
     config_file = self.options.get('config_file')
     if not config_file:
         return
     config = ConfigParser.ConfigParser()
     try:
         config.readfp(open(config_file))
         for (key, value) in config.items('options'):
             if value in ('True', 'False'):
                 value = eval(value)
             self.options[key] = value
         for section in config.sections():
             if section != 'options':
                 _logger.warning("Only options section is taken into account in upgrades configuration")
     except (IOError, ConfigParser.NoSectionError):
         return
Example #4
0
 def load(self):
     config_file = self.options.get('config_file')
     if not config_file:
         return
     config = ConfigParser.ConfigParser()
     try:
         config.readfp(open(config_file))
         for (key, value) in config.items('options'):
             if value in ('True', 'False'):
                 value = eval(value)
             self.options[key] = value
         for section in config.sections():
             if section != 'options':
                 _logger.warning(
                     "Only options section is taken into account in upgrades configuration"
                 )
     except (IOError, ConfigParser.NoSectionError):
         pass