// Disable disables a vhost endpoint
778061
func (h *VHostHandler) Disable() {
	h.mu.Lock()
	defer h.mu.Unlock()
	h.enabled = false
}
262739
func Disable() error {
	log.Print("Disabling gvisor...")
	if err := os.Remove(filepath.Join(nodeDir, constants.ContainerdConfigTomlPath)); err != nil {
		return errors.Wrapf(err, "removing %s", constants.ContainerdConfigTomlPath)
	}
	log.Printf("Restoring default config.toml at %s", constants.ContainerdConfigTomlPath)
	if err := mcnutils.CopyFile(filepath.Join(nodeDir, constants.StoredContainerdConfigTomlPath), filepath.Join(nodeDir, constants.ContainerdConfigTomlPath)); err != nil {
		return errors.Wrap(err, "reverting back to default config.toml")
	}
	// restart containerd
	if err := restartContainerd(); err != nil {
		return errors.Wrap(err, "restarting containerd")
	}
	log.Print("Successfully disabled gvisor")
	return nil
}
1202596
func (m *CorsPolicy) GetEnabled() *types.BoolValue {
	if x, ok := m.GetEnabledSpecifier().(*CorsPolicy_Enabled); ok {
		return x.Enabled
	}
	return nil
}
1133769
func (s *Service) EnableVirtualHost(application, vhostName string, enable bool) error {
	appFound := false
	vhostFound := false
	for _, ep := range s.GetServiceVHosts() {
		if ep.Application == application {
			appFound = true
			for i, vhost := range ep.VHostList {
				if vhost.Name == vhostName {
					vhostFound = true
					ep.VHostList[i].Enabled = enable
					plog.WithFields(log.Fields{
						"vhostname":   vhostName,
						"serviceid":   s.ID,
						"application": application,
						"enable":      enable,
					}).Debug("Enable vhost")
				}
			}
		}
	}
	if !appFound {
		return fmt.Errorf("vhost %s not found; application %s not found in service %s:%s", vhostName, application, s.ID, s.Name)
	}
	if !vhostFound {
		return fmt.Errorf("vhost %s not found in service %s:%s", vhostName, s.ID, s.Name)
	}

	return nil
}
418181
func (j *JournalManager) Disable(ctx context.Context, tlfID tlf.ID) (
	wasEnabled bool, err error) {
	j.log.CDebugf(ctx, "Disabling journal for %s", tlfID)
	defer func() {
		if err != nil {
			j.deferLog.CDebugf(ctx,
				"Error when disabling journal for %s: %+v",
				tlfID, err)
		}
	}()

	j.lock.Lock()
	defer j.lock.Unlock()
	tlfJournal, ok := j.tlfJournals[tlfID]
	if !ok {
		j.log.CDebugf(ctx, "Journal doesn't exist for %s", tlfID)
		return false, nil
	}

	if j.dirtyOps[tlfID] > 0 {
		return false, errors.Errorf("Can't disable journal for %s while there "+
			"are outstanding dirty ops", tlfID)
	}
	if j.delegateDirtyBlockCache.IsAnyDirty(tlfID) {
		return false, errors.Errorf("Can't disable journal for %s while there "+
			"are any dirty blocks outstanding", tlfID)
	}

	// Disable the journal.  Note that we don't bother deleting the
	// journal from j.tlfJournals, to avoid cases where something
	// keeps it around doing background work or re-enables it, at the
	// same time JournalManager creates a new journal for the same TLF.
	wasEnabled, err = tlfJournal.disable()
	if err != nil {
		return false, err
	}

	if wasEnabled {
		j.log.CDebugf(ctx, "Disabled journal for %s", tlfID)
	}
	return wasEnabled, nil
}
825982
func (r *Docker) Enable() error {
	if err := disableOthers(r, r.Runner); err != nil {
		glog.Warningf("disableOthers: %v", err)
	}
	return r.Runner.Run("sudo systemctl start docker")
}
470000
func (m *ARPMechanism) Disable() {
	m.BaseMechanism.Disable()

	// Remove installed handlers
	m.filter.Unhandle()

	// Match packets of ARP protocol.
	match := ofp.Match{ofp.MT_OXM, []ofp.OXM{
		ofputil.EthType(uint16(iana.ETHT_ARP), nil),
	}}

	err := of.Send(m.C.Switch.Conn(),
		// Flush installed flows
		ofputil.TableFlush(ofp.Table(m.tableNo)),
		// Flush redirect flow
		ofputil.FlowFlush(0, match),
	)

	// Release acquired table
	m.C.Switch.ReleaseTable(m.tableNo)

	if err != nil {
		log.ErrorLog("arp/DISABLE_HOOK",
			"Failed to send requests: ", err)
	}

	log.InfoLog("arp/DISABLE_HOOK", "Mechanism ARP disabled")
}
1342694
func (ip *Interpreter) enable(args []string) {
	ip.simpleResponder(ip.Backend.EnableUser(args[0]))
}
220659
func (m *BaseMechanismManager) Disable() {
	atomic.StoreInt64(&m.activated, 0)
	atomic.StoreInt64(&m.enabled, 0)

	m.Mechanisms.Iter(func(_ string, mechanism Mechanism) bool {
		mechanism.Disable()
		return true
	})
}
606042
func (h *VHostHandler) Enable() {
	h.mu.Lock()
	defer h.mu.Unlock()
	h.enabled = true
}
1369259
func (sp *serverPeer) setDisableRelayTx(disable bool) {
	sp.relayMtx.Lock()
	sp.disableRelayTx = disable
	sp.relayMtx.Unlock()
}
368207
func Enable(addr string) <-chan error {
	errs := make(chan error, 1)

	go func() {
		// The Handler function provides a default handler to expose metrics
		// via an HTTP server. "/metrics" is the usual endpoint for that.
		http.Handle("/metrics", promhttp.HandlerFor(registry, promhttp.HandlerOpts{}))
		errs <- http.ListenAndServe(addr, nil)
	}()

	return errs
}
810761
func Enable() {
	go func() {
		if err := http.ListenAndServe(apiAddress, nil); err != nil {
			log.WithError(err).Warn("Unable to serve pprof API")
		}
	}()
}
784255
func (vm *VM) Halt() error {
	vmclient, err := vm.getVMClient()
	if err != nil {
		return fmt.Errorf(errGetClient, err)
	}

	reqID, err := vmclient.ShutdownRole(vm.ServiceName, vm.Name, vm.Name, virtualmachine.PostShutdownActionStopped)

	if err != nil {
		return err
	}

	// Wait for the shutdown
	if err := client.WaitForOperation(reqID, nil); err != nil {
		return fmt.Errorf("Error waiting for instance %s to be shutting down the hosted service %s: %s",
			vm.Name, vm.Name, err)
	}
	return nil
}
938805
func IsEnabled(feature string, options ...FeatureOption) bool {
	return defaultClient.IsEnabled(feature, options...)
}
144421
func (r *runtimeVerbose) isEnabled(from string) bool {
	isEnabled := false
	for _, reg := range r.VerboseRegs {
		if reg.MatchString(from) {
			isEnabled = true
			break
		}
	}
	return isEnabled
}
752080
func (c *LayerTree) Disable() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "LayerTree.disable"})
}