예제 #1
0
파일: uniter.go 프로젝트: zhouqt/juju
// CurrentEnvironUUID returns the UUID for the current juju environment.
func (u *UniterAPI) CurrentEnvironUUID() (params.StringResult, error) {
	result := params.StringResult{}
	env, err := u.st.Environment()
	if err == nil {
		result.Result = env.UUID()
	}
	return result, err
}
예제 #2
0
파일: uniter.go 프로젝트: bac/juju
// ProviderType returns the provider type used by the current juju
// model.
//
// TODO(dimitern): Refactor the uniter to call this instead of calling
// ModelConfig() just to get the provider type. Once we have machine
// addresses, this might be completely unnecessary though.
func (u *UniterAPIV3) ProviderType() (params.StringResult, error) {
	result := params.StringResult{}
	cfg, err := u.st.ModelConfig()
	if err == nil {
		result.Result = cfg.Type()
	}
	return result, err
}
예제 #3
0
파일: uniter_base.go 프로젝트: imoapps/juju
// ProviderType returns the provider type used by the current juju
// environment.
//
// TODO(dimitern): Refactor the uniter to call this instead of calling
// EnvironConfig() just to get the provider type. Once we have machine
// addresses, this might be completely unnecessary though.
func (u *uniterBaseAPI) ProviderType() (params.StringResult, error) {
	result := params.StringResult{}
	cfg, err := u.st.EnvironConfig()
	if err == nil {
		result.Result = cfg.Type()
	}
	return result, err
}