vsphere/resource_vsphere_datastore_cluster.go
func resourceVSphereDatastoreClusterValidateEmptyCluster(d structure.ResourceIDStringer, pod *object.StoragePod) error {
	log.Printf("[DEBUG] %s: Checking to ensure that datastore cluster is empty", resourceVSphereDatastoreClusterIDString(d))
	ne, err := storagepod.HasChildren(pod)
	if err != nil {
		return fmt.Errorf("error checking for datastore cluster contents: %s", err)
	}
	if ne {
		return fmt.Errorf(
			"datastore cluster %q still has datastores. Please move or remove all datastores before deleting",
			pod.InventoryPath,
		)
	}
	return nil
}
func resourceVSphereDatastoreClusterValidateEmptyCluster(d structure.ResourceIDStringer, pod *object.StoragePod) error {
	log.Printf("[DEBUG] %s: Checking to ensure that datastore cluster is empty", resourceVSphereDatastoreClusterIDString(d))
	ne, err := storagepod.HasChildren(pod)
	if err != nil {
		return fmt.Errorf("error checking for datastore cluster contents: %s", err)
	}
	if ne {
		return fmt.Errorf(
			"datastore cluster %q still has datastores. Please move or remove all datastores before deleting",
			pod.InventoryPath,
		)
	}
	return nil
}
func resourceVSphereDatastoreClusterValidateEmptyCluster ( d structure . ResourceIDStringer , pod * object . StoragePod ) error { log . Printf ( " " , resourceVSphereDatastoreClusterIDString ( d ) ) ne , err := storagepod . HasChildren ( pod ) if err != nil { return fmt . Errorf ( " " , err ) } if ne { return fmt . Errorf ( " " , pod . InventoryPath , ) } return nil }
// resourceVSphereDatastoreClusterValidateEmptyCluster validates that the
// datastore cluster is empty. This is used to ensure a safe deletion of the
// cluster - we do not allow deletion of clusters that still have datastores in
// them.
resourceVSphereDatastoreClusterValidateEmptyCluster validates that the datastore cluster is empty . This is used to ensure a safe deletion of the cluster - we do not allow deletion of clusters that still have datastores in them .