// checkConfigHostRemoveSyntax - verifies input arguments to 'config host remove'.
513827
func checkConfigHostRemoveSyntax(ctx *cli.Context) {
	args := ctx.Args()

	if len(ctx.Args()) != 1 {
		fatalIf(errInvalidArgument().Trace(args...),
			"Incorrect number of arguments for remove host command.")
	}

	if !isValidAlias(args.Get(0)) {
		fatalIf(errDummy().Trace(args.Get(0)),
			"Invalid alias `"+args.Get(0)+"`.")
	}
}
437960
func (h NoXattrHandler) Removexattr(context.Context, *fuse.RemovexattrRequest) error {
	return fuse.ENOTSUP
}
580233
func (f *Facade) RemoveHostExpiration(ctx datastore.Context, hostid string) {
	defer ctx.Metrics().Stop(ctx.Metrics().Start("Facade.RemoveHostExpiration"))
	f.hostRegistry.Remove(hostid)
}
105929
func mainConfigHost(ctx *cli.Context) error {
	cli.ShowCommandHelp(ctx, ctx.Args().First())
	return nil
	// Sub-commands like "remove", "list" have their own main.
}
1076638
func DeregisterTLSConfig(key string) {
	tlsConfigLock.Lock()
	if tlsConfigRegistry != nil {
		delete(tlsConfigRegistry, key)
	}
	tlsConfigLock.Unlock()
}
995357
func (c *configV7) setHost(alias string, cfg hostConfigV7) {
	if _, ok := c.Hosts[alias]; !ok {
		c.Hosts[alias] = cfg
	}
}
331921
func (c *ServicedCli) cmdTemplateRemove(ctx *cli.Context) {
	args := ctx.Args()
	if len(args) < 1 {
		fmt.Printf("Incorrect Usage.\n\n")
		cli.ShowCommandHelp(ctx, "remove")
		return
	}

	for _, id := range args {
		if err := c.driver.RemoveServiceTemplate(id); err != nil {
			fmt.Fprintf(os.Stderr, "%s: %s\n", id, err)
		} else {
			fmt.Println(id)
		}
	}
}
959442
func (s *VPCRouterSetting) RemoveRemoteAccessUserAt(index int) {
	if s.RemoteAccessUsers == nil {
		return
	}

	if s.RemoteAccessUsers.Config == nil || len(s.RemoteAccessUsers.Config) == 0 {
		s.RemoteAccessUsers.Enabled = "False"
		return
	}

	if index < len(s.RemoteAccessUsers.Config) {
		c := s.RemoteAccessUsers.Config[index]
		s.RemoveRemoteAccessUser(c.UserName, c.Password)
	}
}
1306266
func (engine *OrcEngine) checkDependsRemoveResult(name string, depCtrl *dependsController) {
	tick := time.Tick(5 * time.Second)
	for _ = range tick {
		switch depCtrl.RemoveStatus() {
		case 1:
			log.Infof("<OrcEngine> DependsCtrl %s is safely removed", name)
			engine.Lock()
			delete(engine.rmDepCtrls, name)
			engine.Unlock()
			return
		case 2:
			log.Infof("<OrcEngine> DependsCtrl %s cannot be removed, someone maybe using it", name)
			engine.Lock()
			engine.dependsCtrls[name] = depCtrl
			delete(engine.rmDepCtrls, name)
			engine.Unlock()
			return
		}
	}
}
123172
func (s *GuestOSService) NewRemoveGuestOsParams(id string) *RemoveGuestOsParams {
	p := &RemoveGuestOsParams{}
	p.p = make(map[string]interface{})
	p.p["id"] = id
	return p
}
1077508
func (reg *HostExpirationRegistry) Remove(hostid string) {
	reg.Lock()
	defer reg.Unlock()
	delete(reg.registry, hostid)
}
525592
func (s *Server) checkConfigExistence(tx store.Tx, spec *api.ServiceSpec) error {
	container := spec.Task.GetContainer()
	if container == nil {
		return nil
	}

	var failedConfigs []string
	for _, configRef := range container.Configs {
		config := store.GetConfig(tx, configRef.ConfigID)
		// Check to see if the config exists and configRef.ConfigName matches the actual configName
		if config == nil || config.Spec.Annotations.Name != configRef.ConfigName {
			failedConfigs = append(failedConfigs, configRef.ConfigName)
		}
	}

	if len(failedConfigs) > 0 {
		configStr := "configs"
		if len(failedConfigs) == 1 {
			configStr = "config"
		}

		return status.Errorf(codes.InvalidArgument, "%s not found: %v", configStr, strings.Join(failedConfigs, ", "))

	}

	return nil
}
1157658
func (s *Store) ensureConfigEntryTxn(tx *memdb.Txn, idx uint64, conf structs.ConfigEntry) error {
	// Check for existing configuration.
	existing, err := tx.First(configTableName, "id", conf.GetKind(), conf.GetName())
	if err != nil {
		return fmt.Errorf("failed configuration lookup: %s", err)
	}

	raftIndex := conf.GetRaftIndex()
	if existing != nil {
		existingIdx := existing.(structs.ConfigEntry).GetRaftIndex()
		raftIndex.CreateIndex = existingIdx.CreateIndex
		raftIndex.ModifyIndex = existingIdx.ModifyIndex
	} else {
		raftIndex.CreateIndex = idx
	}
	raftIndex.ModifyIndex = idx

	// Insert the config entry and update the index
	if err := tx.Insert(configTableName, conf); err != nil {
		return fmt.Errorf("failed inserting config entry: %s", err)
	}
	if err := indexUpdateMaxTxn(tx, idx, configTableName); err != nil {
		return fmt.Errorf("failed updating index: %v", err)
	}

	return nil
}
928334
func validateConfigFile(config *configV9) (bool, []string) {
	ok, err := validateConfigVersion(config)
	var validationSuccessful = true
	var errors []string
	if !ok {
		validationSuccessful = false
		errors = append(errors, err)
	}
	hosts := config.Hosts
	for _, hostConfig := range hosts {
		hostConfigHealthOk, hostErrors := validateConfigHost(hostConfig)
		if !hostConfigHealthOk {
			validationSuccessful = false
			errors = append(errors, hostErrors...)
		}
	}
	return validationSuccessful, errors
}
315953
func LRemovexattr(path string, attr string) (err error) {
	return unix.Lremovexattr(path, attr)
}
879977
func removeSSHHostKeyOp(globalKey string) txn.Op {
	return txn.Op{
		C:      sshHostKeysC,
		Id:     globalKey,
		Remove: true,
	}
}
694931
func (c *Cluster) RemoveConfig(input string) error {
	return c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
		config, err := getConfig(ctx, state.controlClient, input)
		if err != nil {
			return err
		}

		req := &swarmapi.RemoveConfigRequest{
			ConfigID: config.ID,
		}

		_, err = state.controlClient.RemoveConfig(ctx, req)
		return err
	})
}