}
if (!isProvisioned(clusterName)) {
return true;
}
ApiHostRefList hosts = apiResourceRootV6.getClustersResource().listHosts(clusterName);
apiResourceRootV6.getClustersResource().deleteCluster(clusterName);
for (ApiHostRef host : hosts.getHosts()) {
apiResourceRootV6.getHostsResource().deleteHost(host.getHostId());
}
} catch (Exception e) {
throw SoftwareManagementPluginException.DELETE_CLUSTER_FAILED(e, Constants.CDH_PLUGIN_NAME, clusterName);