vsphere/resource_vsphere_compute_cluster.go
func resourceVSphereComputeClusterSaveNameAndPath(d *schema.ResourceData, cluster *object.ClusterComputeResource) error {
	log.Printf(
		"[DEBUG] %s: Saving name and path data for cluster %q",
		resourceVSphereComputeClusterIDString(d),
		cluster.InventoryPath,
	)

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

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

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

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