// Edit changes the selected virtual servers configuration using the given args.
773882
func (s *ServerMethods) Edit(args ...CmdArg) error {
	_, err := s.ExecCmd(NewCmd("serveredit").WithArgs(args...))
	return err
}
308592
func (c *Configurator) Update(config Config) error {
	cert, err := loadKeyPair(config.CertFile, config.KeyFile)
	if err != nil {
		return err
	}
	cas, err := loadCAs(config.CAFile, config.CAPath)
	if err != nil {
		return err
	}

	if err = c.check(config, cas, cert); err != nil {
		return err
	}
	c.Lock()
	c.base = &config
	c.cert = cert
	c.cas = cas
	c.version++
	c.Unlock()
	c.log("Update")
	return nil
}
775740
func (op *CaasOperatorAgent) ChangeConfig(mutate agent.ConfigMutator) error {
	err := op.AgentConf.ChangeConfig(mutate)
	op.configChangedVal.Set(true)
	return errors.Trace(err)
}
208220
func (t *OSesTable) computeChanges(c context.Context, oses []*config.OS) {
	cfgs := make(map[string]*OS, len(oses))
	for _, cfg := range oses {
		cfgs[cfg.Name] = &OS{
			OS: config.OS{
				Name:        cfg.Name,
				Description: cfg.Description,
			},
		}
	}

	for _, os := range t.current {
		if cfg, ok := cfgs[os.Name]; ok {
			// Operating system found in the config.
			if t.needsUpdate(os, cfg) {
				// Operating system doesn't match the config.
				cfg.Id = os.Id
				t.updates = append(t.updates, cfg)
			}
			// Record that the operating system config has been seen.
			delete(cfgs, cfg.Name)
		} else {
			// Operating system not found in the config.
			t.removals = append(t.removals, os)
		}
	}

	// Operating systems remaining in the map are present in the config but not the database.
	// Iterate deterministically over the slice to determine which operating systems need to be added.
	for _, cfg := range oses {
		if os, ok := cfgs[cfg.Name]; ok {
			t.additions = append(t.additions, os)
		}
	}
}
326919
func (n *Network) Update(cmd NetworkUpdateCommand, section NetworkUpdateSection, parentIndex int, xml string, flags NetworkUpdateFlags) error {
	cxml := C.CString(xml)
	defer C.free(unsafe.Pointer(cxml))
	var err C.virError
	result := C.virNetworkUpdateWrapper(n.ptr, C.uint(cmd), C.uint(section), C.int(parentIndex), cxml, C.uint(flags), &err)
	if result == -1 {
		return makeError(&err)
	}
	return nil
}
919731
func (p *printer) change(cl *pb.GerritChange) {
	switch {
	case cl.Host == "chromium-review.googlesource.com":
		p.linkf("https://crrev.com/c/%d/%d", cl.Change, cl.Patchset)
	case cl.Host == "chrome-internal-review.googlesource.com":
		p.linkf("https://crrev.com/i/%d/%d", cl.Change, cl.Patchset)
	default:
		p.linkf("https://%s/c/%s/+/%d/%d", cl.Host, cl.Project, cl.Change, cl.Patchset)
	}
}
1274468
func (computeSystem *System) Modify(config interface{}) (err error) {
	computeSystem.handleLock.RLock()
	defer computeSystem.handleLock.RUnlock()

	operation := "hcsshim::ComputeSystem::Modify"
	computeSystem.logOperationBegin(operation)
	defer func() { computeSystem.logOperationEnd(operation, err) }()

	if computeSystem.handle == 0 {
		return makeSystemError(computeSystem, "Modify", "", ErrAlreadyClosed, nil)
	}

	requestJSON, err := json.Marshal(config)
	if err != nil {
		return err
	}

	requestString := string(requestJSON)

	logrus.WithFields(computeSystem.logctx).
		WithField(logfields.JSON, requestString).
		Debug("HCS ComputeSystem Modify Document")

	var resultp *uint16
	syscallWatcher(computeSystem.logctx, func() {
		err = hcsModifyComputeSystem(computeSystem.handle, requestString, &resultp)
	})
	events := processHcsResult(resultp)
	if err != nil {
		return makeSystemError(computeSystem, "Modify", requestString, err, events)
	}

	return nil
}
7139
func (c *environConfig) update(cfg *config.Config) error {
	// Validate the updates. newValidConfig does not modify the "known"
	// config attributes so it is safe to call Validate here first.
	if err := config.Validate(cfg, c.Config); err != nil {
		return errors.Trace(err)
	}

	updates, err := newValidConfig(cfg)
	if err != nil {
		return errors.Trace(err)
	}

	// Check that no immutable fields have changed.
	attrs := updates.UnknownAttrs()
	for _, field := range configImmutableFields {
		if attrs[field] != c.attrs[field] {
			return errors.Errorf("%s: cannot change from %v to %v", field, c.attrs[field], attrs[field])
		}
	}

	// Apply the updates.
	c.Config = cfg
	c.attrs = cfg.UnknownAttrs()
	return nil
}
1326931
func (state *ServicesState) serverChanged(hostname string, updated time.Time) {
	if !state.HasServer(hostname) {
		log.Errorf("Attempt to change a server we don't have! (%s)", hostname)
		return
	}

	state.Servers[hostname].LastUpdated = updated
	state.Servers[hostname].LastChanged = updated
	state.LastChanged = updated
}
372602
func (s *ConfigurationService) NewUpdateConfigurationParams(name string) *UpdateConfigurationParams {
	p := &UpdateConfigurationParams{}
	p.p = make(map[string]interface{})
	p.p["name"] = name
	return p
}
1204997
func (v *View) EditDelete(back bool) {
	x, y := v.ox+v.cx, v.oy+v.cy
	if y < 0 {
		return
	} else if y >= len(v.viewLines) {
		v.MoveCursor(-1, 0, true)
		return
	}

	maxX, _ := v.Size()
	if back {
		if x == 0 { // start of the line
			if y < 1 {
				return
			}

			var maxPrevWidth int
			if v.Wrap {
				maxPrevWidth = maxX
			} else {
				maxPrevWidth = maxInt
			}

			if v.viewLines[y].linesX == 0 { // regular line
				v.mergeLines(v.cy - 1)
				if len(v.viewLines[y-1].line) < maxPrevWidth {
					v.MoveCursor(-1, 0, true)
				}
			} else { // wrapped line
				v.deleteRune(len(v.viewLines[y-1].line)-1, v.cy-1)
				v.MoveCursor(-1, 0, true)
			}
		} else { // middle/end of the line
			v.deleteRune(v.cx-1, v.cy)
			v.MoveCursor(-1, 0, true)
		}
	} else {
		if x == len(v.viewLines[y].line) { // end of the line
			v.mergeLines(v.cy)
		} else { // start/middle of the line
			v.deleteRune(v.cx, v.cy)
		}
	}
}
973826
func (v *View) Replace(edit *Edit, r text.Region, value string) {
	edit.composite.AddExec(text.NewReplaceAction(v.buffer, r, value))
}
1006487
func (edit *TextEditor) Edit(win *Window) EditEvents {
	edit.init(win)
	if edit.Maxlen > 0 {
		if len(edit.Buffer) > edit.Maxlen {
			edit.Buffer = edit.Buffer[:edit.Maxlen]
		}
	}

	if edit.Flags&EditNoCursor != 0 {
		edit.Cursor = len(edit.Buffer)
	}
	if edit.Flags&EditSelectable == 0 {
		edit.SelectStart = edit.Cursor
		edit.SelectEnd = edit.Cursor
	}

	var bounds rect.Rect

	style := &edit.win.ctx.Style
	widget_state, bounds, _ := edit.win.widget()
	if !widget_state {
		return 0
	}
	in := edit.win.inputMaybe(widget_state)

	var cut, copy, paste bool

	if w := win.ContextualOpen(0, image.Point{}, bounds, nil); w != nil {
		w.Row(20).Dynamic(1)
		visible := false
		if edit.Flags&EditClipboard != 0 {
			visible = true
			if w.MenuItem(label.TA("Cut", "LC")) {
				cut = true
			}
			if w.MenuItem(label.TA("Copy", "LC")) {
				copy = true
			}
			if w.MenuItem(label.TA("Paste", "LC")) {
				paste = true
			}
		}
		if edit.Flags&EditMultiline != 0 {
			visible = true
			if w.MenuItem(label.TA("Find...", "LC")) {
				edit.popupFind()
			}
		}
		if !visible {
			w.Close()
		}
	}

	ev := edit.doEdit(bounds, &style.Edit, in, cut, copy, paste)
	return ev
}
121770
func (r Network_Interconnect_Tenant) EditConnection(receivedObject *datatypes.Network_Interconnect_Tenant) (resp string, err error) {
	params := []interface{}{
		receivedObject,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Interconnect_Tenant", "editConnection", params, &r.Options, &resp)
	return
}
487801
func (n *nessusImpl) EditUser(userID int, permissions, name, email string) (*User, error) {
	if n.verbose {
		log.Println("Editing user...")
	}
	data := editUserRequest{}

	if permissions != "" {
		data.Permissions = permissions
	}
	if name != "" {
		data.Name = name
	}
	if email != "" {
		data.Email = email
	}

	resp, err := n.doRequest("PUT", fmt.Sprintf("/users/%d", userID), data, []int{http.StatusOK})
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	reply := &User{}
	if err = json.NewDecoder(resp.Body).Decode(&reply); err != nil {
		return nil, err
	}
	return reply, nil
}
1051179
func AddChanges(repoPath string, all bool, files ...string) error {
	cmd := NewCommand("add")
	if all {
		cmd.AddArguments("--all")
	}
	_, err := cmd.AddArguments(files...).RunInDir(repoPath)
	return err
}
529245
func (e *Engine) updateVservers() {
	e.clusterLock.RLock()
	cluster := e.cluster
	e.clusterLock.RUnlock()

	// Delete vservers that no longer exist in the new configuration.
	for name, vserver := range e.vservers {
		if cluster.Vservers[name] == nil {
			log.Infof("Stopping unconfigured vserver %s", name)
			vserver.stop()
			<-vserver.stopped
			delete(e.vservers, name)
			e.vserverLock.Lock()
			delete(e.vserverSnapshots, name)
			e.vserverLock.Unlock()
		}
	}

	// Spawn new vservers and provide current configurations.
	for _, config := range cluster.Vservers {
		if e.vservers[config.Name] == nil {
			vserver := newVserver(e)
			go vserver.run()
			e.vservers[config.Name] = vserver
		}
	}
	for _, override := range e.overrides {
		e.distributeOverride(override)
	}
	for _, config := range cluster.Vservers {
		e.vservers[config.Name].updateConfig(config)
	}
}