policy = TopologyType.NONE;
}
clusterCreate.setTopologyPolicy(policy);
DistroRead distroRead4Create;
try {
if (distro != null) {
DistroRead[] distroReads =
appManagerRestClient
.getDistros(clusterCreate.getAppManager());
distroRead4Create = getDistroByName(distroReads, distro);
if (distroRead4Create == null) {
CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
name, Constants.OUTPUT_OP_CREATE,
Constants.OUTPUT_OP_RESULT_FAIL, Constants.PARAM_DISTRO
+ Constants.PARAM_NOT_SUPPORTED
+ getDistroNames(distroReads));
return;
}
} else {
distroRead4Create =
appManagerRestClient.getDefaultDistro(clusterCreate
.getAppManager());
if (distroRead4Create == null
|| CommandsUtils.isBlank(distroRead4Create.getName())) {
CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,
name, Constants.OUTPUT_OP_CREATE,
Constants.OUTPUT_OP_RESULT_FAIL,
Constants.PARAM_NO_DEFAULT_DISTRO);
return;
}
}
} catch (CliRestException e) {
CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER, name,
Constants.OUTPUT_OP_CREATE, Constants.OUTPUT_OP_RESULT_FAIL,
e.getMessage());
return;
}
clusterCreate.setDistro(distroRead4Create.getName());
clusterCreate.setDistroVendor(distroRead4Create.getVendor());
clusterCreate.setDistroVersion(distroRead4Create.getVersion());
if (rpNames != null) {
List<String> rpNamesList = CommandsUtils.inputsConvert(rpNames);
if (rpNamesList.isEmpty()) {
CommandsUtils.printCmdFailure(Constants.OUTPUT_OBJECT_CLUSTER,