vsphere/resource_vsphere_datastore_cluster.go
func resourceVSphereDatastoreClusterSaveNameAndPath(d *schema.ResourceData, pod *object.StoragePod) error {
	log.Printf(
		"[DEBUG] %s: Saving name and path data for datastore cluster %q",
		resourceVSphereDatastoreClusterIDString(d),
		pod.InventoryPath,
	)

	if err := d.Set("name", pod.Name()); err != nil {
		return fmt.Errorf("error saving name: %s", err)
	}

	f, err := folder.RootPathParticleDatastore.SplitRelativeFolder(pod.InventoryPath)
	if err != nil {
		return fmt.Errorf("error parsing datastore cluster path %q: %s", pod.InventoryPath, err)
	}
	if err := d.Set("folder", folder.NormalizePath(f)); err != nil {
		return fmt.Errorf("error saving folder: %s", err)
	}
	return nil
}
func resourceVSphereDatastoreClusterSaveNameAndPath(d *schema.ResourceData, pod *object.StoragePod) error {
	log.Printf(
		"[DEBUG] %s: Saving name and path data for datastore cluster %q",
		resourceVSphereDatastoreClusterIDString(d),
		pod.InventoryPath,
	)

	if err := d.Set("name", pod.Name()); err != nil {
		return fmt.Errorf("error saving name: %s", err)
	}

	f, err := folder.RootPathParticleDatastore.SplitRelativeFolder(pod.InventoryPath)
	if err != nil {
		return fmt.Errorf("error parsing datastore cluster path %q: %s", pod.InventoryPath, err)
	}
	if err := d.Set("folder", folder.NormalizePath(f)); err != nil {
		return fmt.Errorf("error saving folder: %s", err)
	}
	return nil
}
func resourceVSphereDatastoreClusterSaveNameAndPath ( d * schema . ResourceData , pod * object . StoragePod ) error { log . Printf ( " " , resourceVSphereDatastoreClusterIDString ( d ) , pod . InventoryPath , ) if err := d . Set ( " " , pod . Name ( ) ) ; err != nil { return fmt . Errorf ( " " , err ) } f , err := folder . RootPathParticleDatastore . SplitRelativeFolder ( pod . InventoryPath ) if err != nil { return fmt . Errorf ( " " , pod . InventoryPath , err ) } if err := d . Set ( " " , folder . NormalizePath ( f ) ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
// resourceVSphereDatastoreClusterSaveNameAndPath saves the name and path of a
// StoragePod into the supplied ResourceData.
resourceVSphereDatastoreClusterSaveNameAndPath saves the name and path of a StoragePod into the supplied ResourceData .