// GetConfigPolicy returns the plugin's policy
971517
func (s *SessionState) GetConfigPolicy(args []byte, reply *[]byte) error {
	defer catchPluginPanic(s.Logger())

	s.logger.Debug("GetConfigPolicy called")

	policy, err := s.plugin.GetConfigPolicy()
	if err != nil {
		return errors.New(fmt.Sprintf("GetConfigPolicy call error : %s", err.Error()))
	}

	r := GetConfigPolicyReply{Policy: policy}
	*reply, err = s.Encode(r)
	if err != nil {
		return err
	}

	return nil
}
1337184
func (pm *ManagerImpl) GetPolicy(id string) (Policy, bool) {
	if id == "" {
		logger.Errorf("Returning dummy reject all policy because no policy ID supplied")
		return rejectPolicy(id), false
	}
	var relpath string

	if strings.HasPrefix(id, PathSeparator) {
		if !strings.HasPrefix(id, PathSeparator+pm.path) {
			logger.Debugf("Requested absolute policy %s from %s, returning rejectAll", id, pm.path)
			return rejectPolicy(id), false
		}
		// strip off the leading slash, the path, and the trailing slash
		relpath = id[1+len(pm.path)+1:]
	} else {
		relpath = id
	}

	policy, ok := pm.policies[relpath]
	if !ok {
		logger.Debugf("Returning dummy reject all policy because %s could not be found in %s/%s", id, pm.path, relpath)
		return rejectPolicy(relpath), false
	}

	return &policyLogger{
		policy:     policy,
		policyName: PathSeparator + pm.path + PathSeparator + relpath,
	}, true
}
212208
func (adm *AdminClient) GetConfig() ([]byte, error) {
	// Execute GET on /minio/admin/v1/config to get config of a setup.
	resp, err := adm.executeMethod("GET",
		requestData{relPath: "/v1/config"})
	defer closeResponse(resp)
	if err != nil {
		return nil, err
	}

	if resp.StatusCode != http.StatusOK {
		return nil, httpRespToErrorResponse(resp)
	}
	defer closeResponse(resp)

	return DecryptData(adm.secretAccessKey, resp.Body)
}
978935
func (ps *PolicyStore) loadACLPolicy(ctx context.Context, policyName, policyText string) error {
	return ps.loadACLPolicyNamespaces(ctx, policyName, policyText)
}
1137313
func (f *IdentityClient) GetPluginCapabilities(ctx context.Context, in *csipb.GetPluginCapabilitiesRequest, opts ...grpc.CallOption) (*csipb.GetPluginCapabilitiesResponse, error) {
	return nil, nil
}
764104
func (f *Mock) GetConfigPolicy() (plugin.ConfigPolicy, error) {
	p := plugin.NewConfigPolicy()

	err := p.AddNewStringRule([]string{"intel", "mock", "test%>"}, "name", false, plugin.SetDefaultString("bob"))
	if err != nil {
		return *p, err
	}

	err = p.AddNewStringRule([]string{"intel", "mock", "/foo=㊽"}, "password", true)

	return *p, err
}
966741
func (e *Enforcer) RemoveNamedPolicy(ptype string, params ...interface{}) bool {
	var ruleRemoved bool
	if strSlice, ok := params[0].([]string); len(params) == 1 && ok {
		ruleRemoved = e.removePolicy("p", ptype, strSlice)
	} else {
		policy := make([]string, 0)
		for _, param := range params {
			policy = append(policy, param.(string))
		}

		ruleRemoved = e.removePolicy("p", ptype, policy)
	}

	return ruleRemoved
}
1197010
func GetOperPolicy(obj *PolicyInspect) error {
	// Check if we handle this object
	if objCallbackHandler.PolicyCb == nil {
		log.Errorf("No callback registered for policy object")
		return errors.New("Invalid object type")
	}

	// Perform callback
	err := objCallbackHandler.PolicyCb.PolicyGetOper(obj)
	if err != nil {
		log.Errorf("PolicyDelete retruned error for: %+v. Err: %v", obj, err)
		return err
	}

	return nil
}
1226247
func (s *Plugin) GetCloudConfig(args []string) ([]byte, error) {
	c := pluginutil.NewContext(args, pluginutil.ToCliFlagArray(s.GetFlags()))
	cloudConfig := NewPhotonCloudConfig(c)
	b, err := cloudconfigs.GetDeploymentManifestBytes(cloudConfig)
	if err != nil {
		return nil, err
	}
	return b, nil
}
79846
func (c *client) GetConfiguration(ctx context.Context, throttlerName string) (map[string]*throttlerdatapb.Configuration, error) {
	response, err := c.gRPCClient.GetConfiguration(ctx, &throttlerdatapb.GetConfigurationRequest{
		ThrottlerName: throttlerName,
	})
	if err != nil {
		return nil, vterrors.FromGRPC(err)
	}
	return response.Configurations, nil
}
930159
func (c *agentConfig) getConfig(cmdLineFile string) error {
	if cmdLineFile == "" {
		return grpcStatus.Error(codes.FailedPrecondition, "Kernel cmdline file cannot be empty")
	}

	kernelCmdline, err := ioutil.ReadFile(cmdLineFile)
	if err != nil {
		return err
	}

	words := strings.Fields(string(kernelCmdline))
	for _, word := range words {
		if err := c.parseCmdlineOption(word); err != nil {
			agentLog.WithFields(logrus.Fields{
				"error":  err,
				"option": word,
			}).Warn("Failed to parse kernel option")
		}
	}

	return nil
}
526584
func (RandCollector) GetConfigPolicy() (plugin.ConfigPolicy, error) {
	policy := plugin.NewConfigPolicy()

	//The required-config flag is used for testing plugin-lib-go
	if req {
		policy.AddNewStringRule([]string{"static", "string"},
			"value",
			true,
		)
	}
	policy.AddNewIntRule([]string{"random", "integer"},
		"testint",
		false,
		plugin.SetMaxInt(1000),
		plugin.SetMinInt(0))

	policy.AddNewFloatRule([]string{"random", "float"},
		"testfloat",
		false,
		plugin.SetMaxFloat(1000.0),
		plugin.SetMinFloat(0.0))

	policy.AddNewStringRule([]string{"random", "string"},
		"teststring",
		false,
		plugin.SetDefaultString("some_string"))

	policy.AddNewBoolRule([]string{"random"},
		"testbool",
		false,
		plugin.SetDefaultBool(false))
	return *policy, nil
}
956722
func (s *AutoScaleService) GetAutoScalePolicyByID(id string, opts ...OptionFunc) (*AutoScalePolicy, int, error) {
	p := &ListAutoScalePoliciesParams{}
	p.p = make(map[string]interface{})

	p.p["id"] = id

	for _, fn := range append(s.cs.options, opts...) {
		if err := fn(s.cs, p); err != nil {
			return nil, -1, err
		}
	}

	l, err := s.ListAutoScalePolicies(p)
	if err != nil {
		if strings.Contains(err.Error(), fmt.Sprintf(
			"Invalid parameter id value=%s due to incorrect long value format, "+
				"or entity does not exist", id)) {
			return nil, 0, fmt.Errorf("No match found for %s: %+v", id, l)
		}
		return nil, -1, err
	}

	if l.Count == 0 {
		return nil, l.Count, fmt.Errorf("No match found for %s: %+v", id, l)
	}

	if l.Count == 1 {
		return l.AutoScalePolicies[0], l.Count, nil
	}
	return nil, l.Count, fmt.Errorf("There is more then one result for AutoScalePolicy UUID: %s!", id)
}
11366
func (model Model) GetPolicy(sec string, ptype string) [][]string {
	return model[sec][ptype].Policy
}
356632
func GetPlugin(name string) Plugin {
	// Find the conf store
	pluginMutex.Lock()
	defer pluginMutex.Unlock()
	if pluginList[name] == nil {
		log.Errorf("Objdb Plugin %s not registered", name)
		return nil
	}

	return pluginList[name]
}
1299433
func (p *Plugin) getPMConfig() (path string, err error) {
	var pmConfig Config
	found, err := p.Cfg.LoadValue(&pmConfig)
	if err != nil {
		return path, errors.Errorf("failed to read process manager config file: %v", err)
	}
	if found {
		return pmConfig.TemplatePath, nil
	}
	return path, nil
}
107159
func (k *KubeadmCert) GetConfig(ic *kubeadmapi.InitConfiguration) (*certutil.Config, error) {
	for _, f := range k.configMutators {
		if err := f(ic, &k.config); err != nil {
			return nil, err
		}
	}

	return &k.config, nil
}