Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename 'CreateAllSnapshotsFromVm' into 'CreateSnapshotForVm' leftovers #228

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,10 @@ private void createStatelessSnapshot() {

log.info("Creating stateless snapshot for VM '{}' ({})",
getVm().getName(), getVm().getId());
CreateSnapshotForVmParameters createAllSnapshotsFromVmParameters = buildCreateSnapshotParameters();
CreateSnapshotForVmParameters createSnapshotForVmParameters = buildCreateSnapshotParameters();

ActionReturnValue actionReturnValue = runInternalAction(ActionType.CreateSnapshotForVm,
createAllSnapshotsFromVmParameters,
createSnapshotForVmParameters,
createContextForStatelessSnapshotCreation());

// setting lock to null in order not to release lock twice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public boolean performNextOperation(int completedChildCount) {
}

if (isRemoveAutoGeneratedSnapshotRequired()) {
// This lock is required to prevent CreateAllSnapshotsFromVmCommand from
// This lock is required to prevent CreateSnapshotForVmCommand from
// running at the same time as RemoveSnapshotCommand
//
// This lock was previously acquired by the parent command, but it was released
Expand Down Expand Up @@ -629,10 +629,10 @@ protected boolean validate() {
return false;
}

return validateCreateAllSnapshotsFromVmCommand();
return validateCreateSnapshotForVmCommand();
}

protected boolean validateCreateAllSnapshotsFromVmCommand() {
protected boolean validateCreateSnapshotForVmCommand() {
ActionReturnValue returnValue = CommandHelper.validate(ActionType.CreateSnapshotForVm,
getCreateSnapshotParameters(), getContext().clone());
if (!returnValue.isValid()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import org.ovirt.engine.core.common.utils.SimpleDependencyInjector;
import org.ovirt.engine.core.compat.Guid;

/** A test case for the {@link CreateAllSnapshotsFromVmCommand} class. */
/** A test case for the {@link CreateSnapshotForVmCommand} class. */
@MockitoSettings(strictness = Strictness.LENIENT)
public class CreateSnapshotForVmCommandTest extends BaseCommandTest {
@Spy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void setupCommand() {

private void initSpyCommand() {
doReturn(true).when(command).validateDestDomainsSpaceRequirements();
doReturn(true).when(command).validateCreateAllSnapshotsFromVmCommand();
doReturn(true).when(command).validateCreateSnapshotForVmCommand();
doReturn(true).when(command).setAndValidateQuota();
doReturn(ActionType.LiveMigrateDisk).when(command).getActionType();
}
Expand All @@ -132,7 +132,7 @@ public void validateFailsWhenCreateAllSnapshotFromVmValidationFails() {
initDiskImage(diskImageGroupId, diskImageId);
initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId);

doReturn(false).when(command).validateCreateAllSnapshotsFromVmCommand();
doReturn(false).when(command).validateCreateSnapshotForVmCommand();
assertFalse(command.validate());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ public interface LocalizedEnums extends ConstantsWithLookup {

String ActionType___SetupNetworks();

String ActionType___CreateAllSnapshotsFromVm();
String ActionType___CreateSnapshotForVm();

String ActionType___DetachActionFromRole();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ ActionType___AttachVmToUser=Attach User to VM
ActionType___ChangeDisk=Change CD
ActionType___CommitNetworkChanges=Commit Network changes
ActionType___ConnectStorageToVds=Connect Storage Domain to Host
ActionType___CreateAllSnapshotsFromVm=Create Snapshot
ActionType___CreateSnapshotForVm=Create Snapshot
barpavel marked this conversation as resolved.
Show resolved Hide resolved
ActionType___CreateBrick=Create Brick
ActionType___CreateGlusterVolume=Create Gluster Volume
ActionType___CreateGlusterVolumeGeoRepSession=Created geo-replication session
Expand Down