func WriteModelsFile(models map[string]*ControllerModels) error {
	data, err := yaml.Marshal(modelsCollection{models})
	if err != nil {
		return errors.Annotate(err, "cannot marshal models")
	}
	return utils.AtomicWriteFile(JujuModelsPath(), data, os.FileMode(0600))
}
// WriteModelsFile marshals to YAML details of the given models
// and writes it to the models file.
WriteModelsFile marshals to YAML details of the given models
and writes it to the models file.
// WriteModelsFile marshals to YAML details of the given models // and writes it to the models file .
func WriteModelsFile(models map[string]*ControllerModels) error {
	data, err := yaml.Marshal(modelsCollection{models})
	if err != nil {
		return errors.Annotate(err, "cannot marshal models")
	}
	return utils.AtomicWriteFile(JujuModelsPath(), data, os.FileMode(0600))
}
func WriteModelsFile ( models map [ string ] * ControllerModels ) error { data , err := yaml . Marshal ( modelsCollection { models } ) if err != nil { return errors . Annotate ( err , " " ) } return utils . AtomicWriteFile ( JujuModelsPath ( ) , data , os . FileMode ( 0600 ) ) }
WriteModelsFile marshals to YAML details of the given models
and writes it to the models file.
WriteModelsFile marshals to YAML details of the given models and writes it to the models file .