// Charm mocks base method
334736
func (m *MockModelCache) Charm(arg0 string) (instancemutater.ModelCacheCharm, error) {
	ret := m.ctrl.Call(m, "Charm", arg0)
	ret0, _ := ret[0].(instancemutater.ModelCacheCharm)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
288537
func MockContext() sessionctx.Context {
	ctx := mock.NewContext()
	ctx.Store = &mock.Store{
		Client: &mock.Client{},
	}
	ctx.GetSessionVars().CurrentDB = "test"
	do := &domain.Domain{}
	do.CreateStatsHandle(ctx)
	domain.BindDomain(ctx, do)
	return ctx
}
1141245
func (m *testRPC) MockContextList(t *testing.T, impl func() []string) {
	m.currentMocks(t).ContextListMock = impl
}
588989
func (d *manifestDeployer) CharmPath(path string) string {
	return filepath.Join(d.charmPath, path)
}
362337
func (c *Client) CharmRelations(application string) ([]string, error) {
	var results params.ApplicationCharmRelationsResults
	args := params.ApplicationCharmRelations{ApplicationName: application}
	err := c.facade.FacadeCall("CharmRelations", args, &results)
	return results.CharmRelations, err
}
34657
func (f *Facade) Charm(args params.Entities) (params.ApplicationCharmResults, error) {
	results := params.ApplicationCharmResults{
		Results: make([]params.ApplicationCharmResult, len(args.Entities)),
	}
	authTag := f.auth.GetAuthTag()
	for i, entity := range args.Entities {
		tag, err := names.ParseApplicationTag(entity.Tag)
		if err != nil {
			results.Results[i].Error = common.ServerError(err)
			continue
		}
		if tag != authTag {
			results.Results[i].Error = common.ServerError(common.ErrPerm)
			continue
		}
		application, err := f.state.Application(tag.Id())
		if err != nil {
			results.Results[i].Error = common.ServerError(err)
			continue
		}
		charm, force, err := application.Charm()
		if err != nil {
			results.Results[i].Error = common.ServerError(err)
			continue
		}
		results.Results[i].Result = &params.ApplicationCharm{
			URL:                  charm.URL().String(),
			ForceUpgrade:         force,
			SHA256:               charm.BundleSha256(),
			CharmModifiedVersion: application.CharmModifiedVersion(),
		}
	}
	return results, nil
}
1189476
func (st *State) AllCharms() ([]*Charm, error) {
	charmsCollection, closer := st.db().GetCollection(charmsC)
	defer closer()
	var cdoc charmDoc
	var charms []*Charm
	iter := charmsCollection.Find(nsLife.notDead()).Iter()
	for iter.Next(&cdoc) {
		ch := newCharm(st, &cdoc)
		charms = append(charms, ch)
	}
	return charms, errors.Trace(iter.Close())
}
495900
func (m *MockLambdaAPI) InvokeAsync(arg0 *lambda.InvokeAsyncInput) (*lambda.InvokeAsyncOutput, error) {
	ret := m.ctrl.Call(m, "InvokeAsync", arg0)
	ret0, _ := ret[0].(*lambda.InvokeAsyncOutput)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
3719
func (m *MockTransactional) Rollback(arg0 context.Context) error {
	ret := m.ctrl.Call(m, "Rollback", arg0)
	ret0, _ := ret[0].(error)
	return ret0
}
235292
func (m *MockInterface) Batch() v13.BatchV1Interface {
	ret := m.ctrl.Call(m, "Batch")
	ret0, _ := ret[0].(v13.BatchV1Interface)
	return ret0
}
1292502
func (m *MockLambdaAPI) DeleteFunctionConcurrency(arg0 *lambda.DeleteFunctionConcurrencyInput) (*lambda.DeleteFunctionConcurrencyOutput, error) {
	ret := m.ctrl.Call(m, "DeleteFunctionConcurrency", arg0)
	ret0, _ := ret[0].(*lambda.DeleteFunctionConcurrencyOutput)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1217737
func (a *Application) CharmURL() (curl *charm.URL, force bool) {
	return a.doc.CharmURL, a.doc.ForceCharm
}
959928
func Mock(c config.Config, conn sol.Conn) *Auth {
	return create(c, conn, MockUsers(conn))
}
813837
func (api *InstanceMutaterAPI) CharmProfilingInfo(arg params.Entity) (params.CharmProfilingInfoResult, error) {
	result := params.CharmProfilingInfoResult{
		ProfileChanges: make([]params.ProfileInfoResult, 0),
	}
	canAccess, err := api.getAuthFunc()
	if err != nil {
		return params.CharmProfilingInfoResult{}, errors.Trace(err)
	}
	tag, err := names.ParseMachineTag(arg.Tag)
	if err != nil {
		result.Error = common.ServerError(common.ErrPerm)
		return result, nil
	}
	m, err := api.getCacheMachine(canAccess, tag)
	if err != nil {
		result.Error = common.ServerError(err)
		return result, nil
	}
	lxdProfileInfo, err := api.machineLXDProfileInfo(m)
	if err != nil {
		result.Error = common.ServerError(errors.Annotatef(err, "%s", tag))
	}

	// use the results from the machineLXDProfileInfo and apply them to the
	// result
	result.InstanceId = lxdProfileInfo.InstanceId
	result.ModelName = lxdProfileInfo.ModelName
	result.CurrentProfiles = lxdProfileInfo.MachineProfiles
	result.ProfileChanges = lxdProfileInfo.ProfileUnits

	return result, nil
}
1027834
func (a *Application) Charm() (ch *Charm, force bool, err error) {
	// We don't worry about the channel since we aren't interacting
	// with the charm store here.
	ch, err = a.st.Charm(a.doc.CharmURL)
	if err != nil {
		return nil, false, err
	}
	return ch, a.doc.ForceCharm, nil
}
26998
func (m *MockInterface) AppsV1beta2() v1beta2.AppsV1beta2Interface {
	ret := m.ctrl.Call(m, "AppsV1beta2")
	ret0, _ := ret[0].(v1beta2.AppsV1beta2Interface)
	return ret0
}
308200
func (m *MockLambdaAPI) GetFunctionConfigurationWithContext(arg0 aws.Context, arg1 *lambda.GetFunctionConfigurationInput, arg2 ...request.Option) (*lambda.FunctionConfiguration, error) {
	varargs := []interface{}{arg0, arg1}
	for _, a := range arg2 {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "GetFunctionConfigurationWithContext", varargs...)
	ret0, _ := ret[0].(*lambda.FunctionConfiguration)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}