Sergey Gotliv has posted comments on this change.
Change subject: backend: unlock imported glance image on create errors
......................................................................
Patch Set 1: Code-Review+1
(2 comments)
1. It looks good and working therefore +1.
2. I think using RemoveImage instead of RemoveDisk is better, but can wait for
... I don't know worjing code is working code, right.
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCreateTaskHandler.java
Line 106: public void endWithFailure() {
Line 107:
enclosingCommand.getParameters().getDiskImage().setImageStatus(ImageStatus.ILLEGAL);
Line 108: ImagesHandler.updateImageStatus(
Line 109:
enclosingCommand.getParameters().getDiskImage().getImageId(),
Line 110:
enclosingCommand.getParameters().getDiskImage().getImageStatus());
You right, you have to do that once you are using RemoveDisk.
It looks like RemoveDisk is not designed to be internal command when the caller
is already LOCKED the image.
Line 111: compensate();
Line 112: enclosingCommand.getReturnValue().setSucceeded(true);
Line 113: }
Line 114:
Line 107:
enclosingCommand.getParameters().getDiskImage().setImageStatus(ImageStatus.ILLEGAL);
Line 108: ImagesHandler.updateImageStatus(
Line 109:
enclosingCommand.getParameters().getDiskImage().getImageId(),
Line 110:
enclosingCommand.getParameters().getDiskImage().getImageStatus());
Line 111: compensate();
RemoveImage calls to Storage(VDSM), swallows ImageIsNotExistsError and then
delete image from DB. By the way, its designed to run as internal command and
has no problems to delete the LOCKED image.
RemoveDisk performs many validations but then it calls to RemoveImage to do the
real job.
Line 112: enclosingCommand.getReturnValue().setSucceeded(true);
Line 113: }
Line 114:
Line 115: @Override
--
To view, visit http://gerrit.ovirt.org/19371
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I49054d36eef780d0902f7dcd448ca44797f42916
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches