Edits an existing ConfigSetting entity.
973546
public function updateAction(Request $request, $id)
    {
        $class_name = $this->container->getParameter('acs_settings.setting_class');
        $settingmanager = $this->get('acs.setting_manager');
        $user_fields = $settingmanager->loadUserFields();
        $em = $this->getDoctrine()->getManager();

        $entity = $this->get('security.context')->getToken()->getUser();

        if (!$entity) {
            throw $this->createNotFoundException('Unable to find ConfigSetting entity.');
        }

        $editForm = $this->createForm(new ConfigSettingCollectionType($user_fields,$em), $entity);

        $editForm->bind($request);


        $postData = $request->request->get('acs_settings_usersettings');

        if ($editForm->isValid()) {
            if (isset($postData['settings'])) {
                    $settings = $postData['settings'];

                    foreach ($settings as $setting) {
                        $args = array(
                            'user' => $entity->getId(),
                            'setting_key' => $setting['setting_key'],
                        );

                        if(isset($setting['service_id'])){
                            $service = $em->getRepository('ACSACSPanelBundle:Service')->find($setting['service_id']);
                            $args['service'] = $service;
                        }

                        $panelsetting = $em->getRepository('ACSACSPanelBundle:PanelSetting')->findOneBy($args);

                        if ($panelsetting && isset($setting['value'])) {
                            $panelsetting->setValue($setting['value']);
                            $em->persist($panelsetting);
                            $em->flush();
                        }
                    }
                    $em->flush();
            }
            return $this->redirect($this->generateUrl('settings'));
        }

        return $this->render('ACSACSPanelSettingsBundle:ConfigSetting:new.html.twig', array(
            'entity' => $entity,
            'form'   => $editForm->createView(),
        ));
    }
1222449
def _configure(changes):

    '''
    
    '''

    cfgred = True
    reasons = []
    fun = 'update_config'

    for key in ['added', 'updated', 'removed']:
        _updated_changes = changes.get(key, {})
        if not _updated_changes:
            continue
        _location = _updated_changes.get('location', '')
        _contact = _updated_changes.get('contact', '')
        _community = _updated_changes.get('community', {})
        _chassis_id = _updated_changes.get('chassis_id', '')
        if key == 'removed':
            fun = 'remove_config'
        _ret = __salt__['snmp.{fun}'.format(fun=fun)](location=_location,
                                                      contact=_contact,
                                                      community=_community,
                                                      chassis_id=_chassis_id,
                                                      commit=False)
        cfgred = cfgred and _ret.get('result')
        if not _ret.get('result') and _ret.get('comment'):
            reasons.append(_ret.get('comment'))

    return {
        'result': cfgred,
        'comment': '\n'.join(reasons) if reasons else ''
    }
1358340
def config(self, config):
        """"""
        for section, data in config.items():
            for variable, value in data.items():
                self.set_value(section, variable, value)
1299031
def update_settings(instance_id, settings)
      params = {
        :instance_id => instance_id
      }

      instance = Models::RegistryInstance[params] || Models::RegistryInstance.new(params)
      instance.settings = settings
      instance.save
    end
310417
def _set_setting(self, settings):
        """"""
        for key, value in settings.items():
            _validate_setting(key, value)

        try:
            self._settings_request(method="patch", json_data=settings)

            self.update(settings_json=settings)
        except SkybellException as exc:
            _LOGGER.warning("Exception changing settings: %s", settings)
            _LOGGER.warning(exc)
126380
public void set(final String originalKey, final Object object) {
        final String key = applicationName + "." + originalKey;
        if (object == null || (object instanceof String && ((String) object).length() == 0)) {
            // remove
            application.setConfig(application.getConfig().withoutPath(key));
        } else {
            // create or update
            ConfigValue value = ConfigValueFactory.fromAnyRef(object, "modified at runtime ");
            application.setConfig(application.getConfig().withValue(key, value));
        }
        // merge global config (no reloading)
        config = application.getConfig().withFallback(user.getConfig()).withFallback(system.getConfig());
    }
110664
protected function prepareConfig()
    {
        $config = config("entity", []);

        $entity = $this->entity;

        if(!isset($config[$entity])){

            throw new \Exception("No configuration found for entity {$entity}.");

        }

        // assign the given config
        $this->config = $config[$entity] + [
            'attributes'    => [],
            'relationships' => [],
            'scope'         => Scope::DISABLED,
        ];

        // merge attribute defaults
        foreach($this->config['attributes'] as $attr => $values){

            $this->config['attributes'][$attr] = $this->applyAttributeDefaults($values);

        }

        // merge relationship defaults
        foreach($this->config['relationships'] as $rel => $values){

            $this->config['relationships'][$rel] = $this->applyRelationshipDefaults($values);
        }

        $this->fillable(array_keys($this->config['attributes']));
    }
481827
public function applyConfigOverrides()
    {
        // init
        $config_items = [];

        foreach ($this->settings_default as $key => $value) {
            if (ee()->config->item($key)) {
                $config_items[$key] = ee()->config->item($key);
            }
        }

        if (is_array($this->settings)) {
            $this->settings = array_merge($this->settings, $config_items);
        }
    }
1334072
def replace(self, scaling_group, name, cooldown, min_entities,
            max_entities, metadata=None):
        
        body = self._create_group_config_body(name, cooldown, min_entities,
                max_entities, metadata=metadata)
        group_id = utils.get_id(scaling_group)
        uri = "/%s/%s/config" % (self.uri_base, group_id)
        resp, resp_body = self.api.method_put(uri, body=body)
823367
def _edit_config(xpath, element):
    '''
    

    '''
    query = {'type': 'config',
             'action': 'edit',
             'xpath': xpath,
             'element': element}

    response = __proxy__['panos.call'](query)

    return _validate_response(response)
934533
def update_config(config_new, config_default):

    '''
    
    '''
    if any([isinstance(v, dict) for v in list(config_new.values())]):
        for k,v in list(config_new.items()):
            if isinstance(v,dict) and k in config_default:
                update_config(config_new[k],config_default[k])
            else:
                config_default[k] = v
    else:
        config_default.update(config_new)
    return config_default
1086139
protected function editSettings()
    {
        $multiSiteSettingsFile = sprintf(
            '%s/sites/'.$this->explodeDirectory[0].'/settings.php',
            $this->appRoot
        );
        if (!$this->fs->exists($multiSiteSettingsFile)) {
            $multiSiteSettingsFile = sprintf(
                '%s/sites/'.$this->directory.'/settings.php',
                $this->appRoot
            );
        }

        $databases = [];
        $config_directories = [];

        if (file_exists($multiSiteSettingsFile)) {
            include $multiSiteSettingsFile;
        }

        try {
            if (!empty($databases) || !empty($config_directories)) {
                //Replace $databases['default']['default']['database']
                $line = explode('/', $databases['default']['default']['database']);
                $string_to_replace= $databases['default']['default']['database'];
                $replace_with="sites/".$this->explodeDirectory[0]."/files/".end($line);
                $content=file_get_contents($multiSiteSettingsFile);
                $content_chunks=explode($string_to_replace, $content);
                $content=implode($replace_with, $content_chunks);

                //Replace $config_directories['sync']
                $string_to_replace= $config_directories['sync'];
                $replace_with=str_replace($this->uri, $this->directory, $config_directories['sync']);
                $content_chunks=explode($string_to_replace, $content);
                $content=implode($replace_with, $content_chunks);
                file_put_contents($multiSiteSettingsFile, $content);
            }
        } catch (IOExceptionInterface $e) {
            $this->getIo()->error(
                sprintf(
                    $this->trans('commands.multisite.update.messages.write-fail'),
                    $multiSiteSettingsFile
                )
            );
            return 1;
        }
    }
776200
def set_configs(self, key, d):
        """"""
        if '_config' in self.proxy:
            self.proxy['_config'][key] = d
        else:
            self.proxy['_config'] = {key: d}
54182
def fix_config(self, options):
        
        opt = "setup"
        if opt not in options:
            options[opt] = conversion.PassThrough()
        if opt not in self.help:
            self.help[opt] = "The conversion to apply to the input data (Conversion)."

        return super(Convert, self).fix_config(options)
416786
def edit_preferences(self):
        """"""
        from spyder.preferences.configdialog import ConfigDialog
        dlg = ConfigDialog(self)
        dlg.size_change.connect(self.set_prefs_size)
        if self.prefs_dialog_size is not None:
            dlg.resize(self.prefs_dialog_size)
        for PrefPageClass in self.general_prefs:
            widget = PrefPageClass(dlg, main=self)
            widget.initialize()
            dlg.add_page(widget)
        for plugin in [self.workingdirectory, self.editor,
                       self.projects, self.ipyconsole,
                       self.historylog, self.help, self.variableexplorer,
                       self.onlinehelp, self.explorer, self.findinfiles
                       ]+self.thirdparty_plugins:
            if plugin is not None:
                try:
                    widget = plugin.create_configwidget(dlg)
                    if widget is not None:
                        dlg.add_page(widget)
                except Exception:
                    traceback.print_exc(file=sys.stderr)
        if self.prefs_index is not None:
            dlg.set_current_index(self.prefs_index)
        dlg.show()
        dlg.check_all_settings()
        dlg.pages_widget.currentChanged.connect(self.__preference_page_changed)
        dlg.exec_()
912450
async def updateconfig(self):
        ""
        exists = {}
        for s in self.connections:
            exists[(s.protocol.vhost, s.rawurl)] = s
        self._createServers(self, '', exists = exists)
        for _,v in exists.items():
            await v.shutdown()
            self.connections.remove(v)
95945
def modify_config_file(updates):
    '''
    
    '''
    cmd = '/bin/sed '
    for key in updates:
        cmd = cmd + '-e \'s/^#*{key}.*=.*$/{key}={value}/\' '.format(key=key, value=updates[key])
    cmd = cmd + constants.default_conf_file
    status = run_command_get_output(cmd)
    write_to_disk(constants.default_conf_file, content=status['output'])