func CloudByName(name string) (*Cloud, error) {
	// Personal clouds take precedence.
	personalClouds, err := PersonalCloudMetadata()
	if err != nil {
		return nil, errors.Trace(err)
	}
	if cloud, ok := personalClouds[name]; ok {
		return &cloud, nil
	}
	clouds, _, err := PublicCloudMetadata(JujuPublicCloudsPath())
	if err != nil {
		return nil, errors.Trace(err)
	}
	if cloud, ok := clouds[name]; ok {
		return &cloud, nil
	}
	return nil, errors.NotFoundf("cloud %s", name)
}
// CloudByName returns the cloud with the specified name.
// If there exists no cloud with the specified name, an
// error satisfying errors.IsNotFound will be returned.
//
// TODO(axw) write unit tests for this.
CloudByName returns the cloud with the specified name.
If there exists no cloud with the specified name, an
error satisfying errors.IsNotFound will be returned.


// CloudByName returns the cloud with the specified name . // If there exists no cloud with the specified name an // error satisfying errors . IsNotFound will be returned . // // TODO ( axw ) write unit tests for this .
func CloudByName(name string) (*Cloud, error) {
	personalClouds, err := PersonalCloudMetadata()
	if err != nil {
		return nil, errors.Trace(err)
	}
	if cloud, ok := personalClouds[name]; ok {
		return &cloud, nil
	}
	clouds, _, err := PublicCloudMetadata(JujuPublicCloudsPath())
	if err != nil {
		return nil, errors.Trace(err)
	}
	if cloud, ok := clouds[name]; ok {
		return &cloud, nil
	}
	return nil, errors.NotFoundf("cloud %s", name)
}
func CloudByName ( name string ) ( * Cloud , error ) { personalClouds , err := PersonalCloudMetadata ( ) if err != nil { return nil , errors . Trace ( err ) } if cloud , ok := personalClouds [ name ] ; ok { return & cloud , nil } clouds , _ , err := PublicCloudMetadata ( JujuPublicCloudsPath ( ) ) if err != nil { return nil , errors . Trace ( err ) } if cloud , ok := clouds [ name ] ; ok { return & cloud , nil } return nil , errors . NotFoundf ( " " , name ) }
CloudByName returns the cloud with the specified name.
CloudByName returns the cloud with the specified name .
// Personal clouds take precedence.