Search in sources :

Example 1 with ProcessOvfUpdateParameters

use of org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters in project ovirt-engine by oVirt.

the class UpdateOvfStoreForStorageDomainCommand method executeCommand.

@Override
protected void executeCommand() {
    Guid storageDomainId = getStorageDomainId();
    ProcessOvfUpdateParameters parameters = new ProcessOvfUpdateParameters(getStoragePoolId(), getStorageDomainId());
    ActionReturnValue actionReturnValue = runInternalAction(ActionType.ProcessOvfUpdateForStoragePool, parameters, getContext());
    Set<Guid> proccessedDomains = actionReturnValue.getActionReturnValue();
    if (!actionReturnValue.getSucceeded()) {
        propagateFailure(actionReturnValue);
        return;
    }
    if (proccessedDomains != null && proccessedDomains.contains(storageDomainId)) {
        actionReturnValue = runInternalActionWithTasksContext(ActionType.ProcessOvfUpdateForStorageDomain, createProcessOvfUpdateForDomainParams());
        if (!actionReturnValue.getSucceeded()) {
            propagateFailure(actionReturnValue);
            return;
        }
    } else {
        addCustomValue("StorageDomainName", getStorageDomain().getName());
        auditLogDirector.log(this, AuditLogType.OVF_STORES_UPDATE_IGNORED);
    }
    setSucceeded(true);
}
Also used : ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) Guid(org.ovirt.engine.core.compat.Guid) ProcessOvfUpdateParameters(org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters)

Example 2 with ProcessOvfUpdateParameters

use of org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters in project ovirt-engine by oVirt.

the class UpdateOvfStoreForStorageDomainCommand method createProcessOvfUpdateForDomainParams.

private ProcessOvfUpdateParameters createProcessOvfUpdateForDomainParams() {
    ProcessOvfUpdateParameters params = new ProcessOvfUpdateParameters(getStoragePoolId(), getStorageDomainId());
    params.setSkipDomainChecks(true);
    if (isExecutedAsChildCommand()) {
        params.setParentCommand(getParameters().getParentCommand());
        params.setEntityInfo(getParameters().getParentParameters().getEntityInfo());
        params.setParentParameters(getParameters().getParentParameters());
    }
    return params;
}
Also used : ProcessOvfUpdateParameters(org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters)

Aggregations

ProcessOvfUpdateParameters (org.ovirt.engine.core.common.action.ProcessOvfUpdateParameters)2 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)1 Guid (org.ovirt.engine.core.compat.Guid)1