// RemoveOfferOperation returns a model operation that will allow relation to leave scope.
347351
func (s *applicationOffers) RemoveOfferOperation(offerName string, force bool) *RemoveOfferOperation {
	return &RemoveOfferOperation{
		offers:          &applicationOffers{s.st},
		offerName:       offerName,
		ForcedOperation: ForcedOperation{Force: force},
	}
}
523068
func (br *Bridge) RemoveSlaveIfc(ifc *net.Interface) error {
	if err := netlink.NetworkSetNoMaster(ifc); err != nil {
		return err
	}

	for index, i := range br.slaveIfcs {
		// I could reflect.DeepEqual(), but there is not point to import reflect for one operation
		if i.Name == ifc.Name && bytes.Equal(i.HardwareAddr, ifc.HardwareAddr) {
			br.slaveIfcs = append(br.slaveIfcs[:index], br.slaveIfcs[index+1:]...)
		}
	}

	return nil
}
653909
func RemoveRelative(path string, root *os.File) error {
	f, err := openRelativeInternal(
		path,
		root,
		FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES|DELETE,
		syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE,
		FILE_OPEN,
		FILE_OPEN_REPARSE_POINT)
	if err == nil {
		defer f.Close()
		err = deleteOnClose(f)
		if err == syscall.ERROR_ACCESS_DENIED {
			// Maybe the file is marked readonly. Clear the bit and retry.
			clearReadOnly(f)
			err = deleteOnClose(f)
		}
	}
	if err != nil {
		return &os.PathError{Op: "remove", Path: filepath.Join(root.Name(), path), Err: err}
	}
	return nil
}
914862
func RemoveOrgUser(c *m.ReqContext) Response {
	return removeOrgUserHelper(&m.RemoveOrgUserCommand{
		UserId: c.ParamsInt64(":userId"),
		OrgId:  c.ParamsInt64(":orgId"),
	})
}
1180502
func (sw *OvsSwitch) RemoveUplinks() error {

	var err error

	// some error checking
	if sw.netType != "vlan" {
		log.Fatalf("Can not remove uplink from OVS type %s.", sw.netType)
	}

	for intfListObj := range sw.uplinkDb.IterBuffered() {
		intfList := intfListObj.Val.([]string)
		portName := intfListObj.Key

		// Remove uplink from agent
		err = sw.ofnetAgent.RemoveUplink(portName)
		if err != nil {
			log.Errorf("Error removing uplink %s. Err: %v", portName, err)
			return err
		}
		log.Infof("Removed uplink %s from ofnet", portName)

		isPortPresent := sw.ovsdbDriver.IsPortNamePresent(portName)
		if len(intfList) == 1 {
			isPortPresent = sw.ovsdbDriver.IsPortNamePresent(intfList[0])
		}
		if isPortPresent {
			if len(intfList) == 1 {
				err = sw.ovsdbDriver.DeletePort(intfList[0])
			} else {
				err = sw.ovsdbDriver.DeletePortBond(portName, intfList)
			}
			if err != nil {
				log.Errorf("Error deleting uplink %s from OVS. Err: %v", portName, err)
				return err
			}
		}
		time.Sleep(time.Second)
		sw.uplinkDb.Remove(portName)

		log.Infof("Removed uplink %s(%+v) from OVS switch %s.", portName, intfList, sw.bridgeName)
	}

	return nil
}
743554
func (s *Section) RemoveOption(key string) *Section {
	s.Options = s.Options.withoutOption(key)
	return s
}
498922
func (c *Controller) removeMachine(ch RemoveMachine) error {
	return errors.Trace(c.removeResident(ch.ModelUUID, func(m *Model) error { return m.removeMachine(ch) }))
}
1042531
func (st *State) RemoveExportingModelDocs() error {
	err := st.removeAllModelDocs(bson.D{{"migration-mode", MigrationModeExporting}})
	if errors.Cause(err) == txn.ErrAborted {
		return errors.New("can't remove model: model not being exported for migration")
	}
	return errors.Trace(err)
}
277460
func removeObjectActions(statement Statement, objectResource string) Statement {
	if statement.Conditions == nil {
		if len(statement.Resources) > 1 {
			statement.Resources.Remove(objectResource)
		} else {
			statement.Actions = statement.Actions.Difference(readOnlyObjectActions)
			statement.Actions = statement.Actions.Difference(writeOnlyObjectActions)
		}
	}

	return statement
}
173254
func RemoveRemote(tx *sql.Tx, blobKey string) error {
	_, err := tx.Exec("DELETE FROM remote WHERE blobkey == $1", blobKey)
	if err != nil {
		return err
	}
	return nil
}
605055
func (repo *Repository) RemoveRemote(name string) error {
	_, err := NewCommand("remote", "remove", name).RunInDir(repo.Path)
	return err
}
174909
func (st *State) RemoveOfferAccess(offer names.ApplicationOfferTag, user names.UserTag) error {
	offerUUID, err := applicationOfferUUID(st, offer.Name)
	if err != nil {
		return errors.Trace(err)
	}

	buildTxn := func(int) ([]txn.Op, error) {
		_, err := st.GetOfferAccess(offerUUID, user)
		if err != nil {
			return nil, err
		}
		isAdmin, err := st.isControllerOrModelAdmin(user)
		if err != nil {
			return nil, errors.Trace(err)
		}
		ops := []txn.Op{removePermissionOp(applicationOfferKey(offerUUID), userGlobalKey(userAccessID(user)))}
		if !isAdmin {
			suspendOps, err := st.suspendRevokedRelationsOps(offerUUID, user.Id())
			if err != nil {
				return nil, errors.Trace(err)
			}
			ops = append(ops, suspendOps...)
		}
		return ops, nil
	}

	err = st.db().Run(buildTxn)
	return errors.Trace(err)
}
1370719
func (h *handler) removeRequestOp(op *requestOp) {
	for _, id := range op.ids {
		delete(h.respWait, string(id))
	}
}
1041742
func (c *AggregationController) RemoveAPIService(apiServiceName string) {
	if err := c.openAPIAggregationManager.RemoveAPIServiceSpec(apiServiceName); err != nil {
		utilruntime.HandleError(fmt.Errorf("removing %q from AggregationController failed with: %v", apiServiceName, err))
	}
	// This will only remove it if it was failing before. If it was successful, processNextWorkItem will figure it out
	// and will not add it again to the queue.
	c.queue.Forget(apiServiceName)
}
578956
func (ns nsRefcounts_) JustRemoveOp(collName, key string, count int) txn.Op {
	op := txn.Op{
		C:      collName,
		Id:     key,
		Remove: true,
	}
	if count >= 0 {
		op.Assert = bson.D{{"refcount", count}}
	}
	return op
}
1039685
func (l *State) RemoveService(id string) error {
	l.Lock()
	defer l.Unlock()
	return l.removeServiceLocked(id)
}
203788
func (u *Unit) DestroyOperation() *DestroyUnitOperation {
	return &DestroyUnitOperation{
		unit: &Unit{st: u.st, doc: u.doc, modelType: u.modelType},
	}
}