// CharmProfiles indicates an expected call of CharmProfiles
351827
func (mr *MockModelCacheMachineMockRecorder) CharmProfiles() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CharmProfiles", reflect.TypeOf((*MockModelCacheMachine)(nil).CharmProfiles))
}
1106647
func (ac *APIController) AppProfileCreate(prof *contivModel.AppProfile) error {
	log.Infof("Received AppProfileCreate: %+v", prof)

	// Make sure tenant exists
	if prof.TenantName == "" {
		return core.Errorf("Invalid tenant name")
	}

	tenant := contivModel.FindTenant(prof.TenantName)
	if tenant == nil {
		return core.Errorf("Tenant %s not found", prof.TenantName)
	}

	for _, epg := range prof.EndpointGroups {
		epgKey := prof.TenantName + ":" + epg
		epgObj := contivModel.FindEndpointGroup(epgKey)
		if epgObj == nil {
			return core.Errorf("EndpointGroup %s not found", epgKey)
		}
		modeldb.AddLinkSet(&prof.LinkSets.EndpointGroups, epgObj)
		modeldb.AddLink(&epgObj.Links.AppProfile, prof)
		err := epgObj.Write()
		if err != nil {
			log.Errorf("Error updating epg state(%+v). Err: %v", epgObj, err)
			return err
		}
	}

	// Setup links
	modeldb.AddLink(&prof.Links.Tenant, tenant)
	modeldb.AddLinkSet(&tenant.LinkSets.AppProfiles, prof)

	err := tenant.Write()
	if err != nil {
		log.Errorf("Error updating tenant state(%+v). Err: %v", tenant, err)
		return err
	}

	err = CreateAppNw(prof)
	return err
}
648032
func WriteProfiles(w io.Writer, profiles []*Profile) error {
	if len(profiles) == 0 {
		return nil
	}

	// We've checked that all input profiles have compatible modes, so we just
	// write out the first one.
	fmt.Fprintf(w, "mode: %s\n", profiles[0].Mode)
	for _, profile := range profiles {
		blocks := profile.Blocks
		for i := range profile.Blocks {
			fmt.Fprintf(w, "%s:%d.%d,%d.%d %d %d\n", profile.FileName,
				blocks[i].StartLine, blocks[i].StartCol,
				blocks[i].EndLine, blocks[i].EndCol,
				blocks[i].NumStmt, blocks[i].Count)
		}
	}

	return nil
}
251830
func (b *BigIP) ClientSSLProfiles() (*ClientSSLProfiles, error) {
	var clientSSLProfiles ClientSSLProfiles
	err, _ := b.getForEntity(&clientSSLProfiles, uriLtm, uriProfile, uriClientSSL)
	if err != nil {
		return nil, err
	}

	return &clientSSLProfiles, nil
}
612201
func (m *MockProfileMachine) CharmProfiles() ([]string, error) {
	ret := m.ctrl.Call(m, "CharmProfiles")
	ret0, _ := ret[0].([]string)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
926041
func (s *DashPackage) SetProfile(v string) *DashPackage {
	s.Profile = &v
	return s
}
137464
func (o *Enterprise) BGPProfiles(info *bambou.FetchingInfo) (BGPProfilesList, *bambou.Error) {

	var list BGPProfilesList
	err := bambou.CurrentSession().FetchChildren(o, BGPProfileIdentity, &list, info)
	return list, err
}
874480
func (m *MockProfileBackend) Charm(arg0 *charm_v6.URL) (provisioner.ProfileCharm, error) {
	ret := m.ctrl.Call(m, "Charm", arg0)
	ret0, _ := ret[0].(provisioner.ProfileCharm)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
927126
func (e Endpoints) PostProfile(ctx context.Context, p Profile) error {
	request := postProfileRequest{Profile: p}
	response, err := e.PostProfileEndpoint(ctx, request)
	if err != nil {
		return err
	}
	resp := response.(postProfileResponse)
	return resp.Err
}
1058061
func (m *MockModelCacheMachine) CharmProfiles() []string {
	ret := m.ctrl.Call(m, "CharmProfiles")
	ret0, _ := ret[0].([]string)
	return ret0
}
889410
func FindAppProfile(key string) *AppProfile {
	collections.appProfileMutex.Lock()
	defer collections.appProfileMutex.Unlock()

	obj := collections.appProfiles[key]
	if obj == nil {
		return nil
	}

	return obj
}
1279930
func (m *Machine) CharmProfilingInfo() (*UnitProfileInfo, error) {
	var result params.CharmProfilingInfoResult
	args := params.Entity{Tag: m.tag.String()}
	err := m.facade.FacadeCall("CharmProfilingInfo", args, &result)
	if err != nil {
		return nil, err
	}
	if result.Error != nil {
		return nil, errors.Trace(result.Error)
	}
	returnResult := &UnitProfileInfo{
		InstanceId:      result.InstanceId,
		ModelName:       result.ModelName,
		CurrentProfiles: result.CurrentProfiles,
	}
	profileChanges := make([]UnitProfileChanges, len(result.ProfileChanges))
	for i, change := range result.ProfileChanges {
		var profile lxdprofile.Profile
		if change.Profile != nil {
			profile = lxdprofile.Profile{
				Config:      change.Profile.Config,
				Description: change.Profile.Description,
				Devices:     change.Profile.Devices,
			}
		}
		profileChanges[i] = UnitProfileChanges{
			ApplicationName: change.ApplicationName,
			Revision:        change.Revision,
			Profile:         profile,
		}
		if change.Error != nil {
			return nil, change.Error
		}
	}
	returnResult.ProfileChanges = profileChanges
	return returnResult, nil
}
202030
func (o *Me) InfrastructureGatewayProfiles(info *bambou.FetchingInfo) (InfrastructureGatewayProfilesList, *bambou.Error) {

	var list InfrastructureGatewayProfilesList
	err := bambou.CurrentSession().FetchChildren(o, InfrastructureGatewayProfileIdentity, &list, info)
	return list, err
}
90276
func (c *Context) Profiles() []string {
	f := c.cmd.Flags.Lookup("profile")
	if f != nil {
		if s := f.Value.String(); s != "" {
			return strings.Split(s, ",")
		}
	}
	return nil
}
932029
func unescapeLXDProfile(profile *charm.LXDProfile) *charm.LXDProfile {
	if profile == nil {
		return nil
	}
	unescapedProfile := charm.NewLXDProfile()
	unescapedProfile.Description = profile.Description
	// we know the size and shape of the type, so let's use UnescapeKey
	unescapedConfig := make(map[string]string, len(profile.Config))
	for k, v := range profile.Config {
		unescapedConfig[mongoutils.UnescapeKey(k)] = v
	}
	unescapedProfile.Config = unescapedConfig
	// this is more easy to reason about than using mongoutils.UnescapeKeys, which
	// requires looping from map[string]interface{} -> map[string]map[string]string
	unescapedDevices := make(map[string]map[string]string, len(profile.Devices))
	for k, v := range profile.Devices {
		nested := make(map[string]string, len(v))
		for vk, vv := range v {
			nested[mongoutils.UnescapeKey(vk)] = vv
		}
		unescapedDevices[mongoutils.UnescapeKey(k)] = nested
	}
	unescapedProfile.Devices = unescapedDevices
	return unescapedProfile
}
225795
func (s *ListSigningProfilesOutput) SetProfiles(v []*SigningProfile) *ListSigningProfilesOutput {
	s.Profiles = v
	return s
}
200119
func profileForContainer(pod *api.Pod, container *api.Container) string {
	containerProfile, ok := pod.Annotations[api.SeccompContainerAnnotationKeyPrefix+container.Name]
	if ok {
		return containerProfile
	}
	return pod.Annotations[api.SeccompPodAnnotationKey]
}