use of org.ovirt.engine.core.common.vdscommands.gluster.ResetGlusterVolumeOptionsVDSParameters in project ovirt-engine by oVirt.
the class ResetGlusterVolumeOptionsCommand method executeCommand.
@Override
protected void executeCommand() {
VDSReturnValue returnValue = runVdsCommand(VDSCommandType.ResetGlusterVolumeOptions, new ResetGlusterVolumeOptionsVDSParameters(upServer.getId(), getGlusterVolumeName(), getParameters().getVolumeOption(), getParameters().isForceAction()));
setSucceeded(returnValue.getSucceeded());
if (getSucceeded()) {
if (getParameters().getVolumeOption() != null && !getParameters().getVolumeOption().getKey().isEmpty()) {
GlusterVolumeOptionEntity entity = getGlusterVolume().getOption(getParameters().getVolumeOption().getKey());
isResetAllOptions = false;
if (entity != null) {
removeOptionInDb(entity);
String optionValue = entity.getValue();
getParameters().getVolumeOption().setValue(optionValue != null ? optionValue : "");
addCustomValue(GlusterConstants.OPTION_KEY, getParameters().getVolumeOption().getKey());
addCustomValue(GlusterConstants.OPTION_VALUE, getParameters().getVolumeOption().getValue());
}
} else {
for (GlusterVolumeOptionEntity option : getGlusterVolume().getOptions()) {
removeOptionInDb(option);
}
isResetAllOptions = true;
}
} else {
handleVdsError(AuditLogType.GLUSTER_VOLUME_OPTIONS_RESET_FAILED, returnValue.getVdsError().getMessage());
return;
}
}
Aggregations