def handle(self, *args, **options): logger.debug("Handling settings") GlobalConfig.initialize() try: for config in args: logger.debug('Config: {}'.format(config)) first, value = config.split('=') first = first.split('.') if len(first) == 2: mod, name = first else: mod, name = GLOBAL_SECTION, first[0] if Config.update(mod, name, value) is False: # If not exists, try to store value without any special parameters Config.section(mod).value(name, value).get() except Exception: logger.exception('Exception processing {}'.format(args))
def handle(self, *args, **options): logger.debug("Handling settings") GlobalConfig.initialize() try: for config in options['name_value']: logger.debug('Config: %s', config) first, value = config.split('=') first = first.split('.') if len(first) == 2: mod, name = first else: mod, name = GLOBAL_SECTION, first[0] if Config.update( mod, name, value ) is False: # If not exists, try to store value without any special parameters Config.section(mod).value(name, value).get() except Exception as e: print('The command could not be processed: {}'.format(e)) logger.exception('Exception processing %s', args)
def put(self): for section, secDict in self._params.items(): for key, vals in secDict.items(): cfgConfig.update(section, key, vals['value']) return 'done'
def put(self): for section, secDict in six.iteritems(self._params): for key, vals in six.iteritems(secDict): cfgConfig.update(section, key, vals['value']) return 'done'
def put(self): for section, secDict in self._params.iteritems(): for key, vals in secDict.iteritems(): cfgConfig.update(section, key, vals["value"]) return "done"