Gilad Chaplik has uploaded a new change for review. Change subject: core: runVmCommandParams: remove get/setInternalExecution (3/X) ......................................................................
core: runVmCommandParams: remove get/setInternalExecution (3/X) AuditLogableBase.isInternalExecution() can be used instead (implemented TODO in code). Change-Id: I225cd8808f5b780f5e79a41b29143eca3d8b721e Signed-off-by: Gilad Chaplik <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java 2 files changed, 6 insertions(+), 19 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/13/13113/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java index 9dd650a..1dc214d 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java @@ -278,7 +278,7 @@ else { statelessVmTreatment(); } - } else if (!getParameters().getIsInternal() && !_isRerun + } else if (!isInternalExecution() && !_isRerun && getVm().getStatus() != VMStatus.Suspended && statelessSnapshotExistsForVm()) { removeVmStatlessImages(); @@ -468,7 +468,7 @@ } if (mResume) { return getSucceeded() ? AuditLogType.USER_RESUME_VM : AuditLogType.USER_FAILED_RESUME_VM; - } else if (getParameters() != null && getParameters().getIsInternal()) { + } else if (getParameters() != null && isInternalExecution()) { return getSucceeded() ? AuditLogType.VDS_INITIATED_RUN_VM : AuditLogType.VDS_INITIATED_RUN_VM_FAILED; } else { return getSucceeded() ? @@ -669,11 +669,6 @@ @Override protected boolean canDoAction() { - // setting the RunVmParams Internal flag according to the command Internal flag. - // we can not use only the command Internal flag and remove this flag from RunVmParams - // since canRunVm is static and can not call non-static method isInternalExecution - getParameters().setIsInternal(isInternalExecution()); - VM vm = getVm(); if (vm == null) { @@ -827,8 +822,8 @@ return ImagesHandler.PerformImagesChecks(message, vm.getStoragePoolId(), Guid.Empty, !vm.isAutoStartup(), true, false, false, - !vm.isAutoStartup() || !runParams.getIsInternal(), - !vm.isAutoStartup() || !runParams.getIsInternal(), + !vm.isAutoStartup() || !isInternalExecution(), + !vm.isAutoStartup() || !isInternalExecution(), vmDisks); } @@ -974,8 +969,8 @@ Job job = JobRepositoryFactory.getJobRepository().getJobWithSteps(step.getJobId()); Step executingStep = job.getDirectStep(StepEnum.EXECUTING); // We would like to to set the run stateless step as substep of executing step - getParameters().setIsInternal(true); - // The iternal command should be monitored for tasks + setInternalExecution(true); + // The internal command should be monitored for tasks runStatelessVmCtx.setMonitored(true); Step runStatelessStep = ExecutionHandler.addSubStep(getExecutionContext(), diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java index 1a6d2ce..04f5d5c 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/RunVmParams.java @@ -74,14 +74,6 @@ _destinationVdsId = value; } - public boolean getIsInternal() { - return _internal; - } - - public void setIsInternal(boolean value) { - _internal = value; - } - public BootSequence getBootSequence() { return _bootSequence; } -- To view, visit http://gerrit.ovirt.org/13113 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I225cd8808f5b780f5e79a41b29143eca3d8b721e Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
