Daniel Erez has posted comments on this change.

Change subject: [wip] backend: add the import glance image support
......................................................................


Patch Set 2: (7 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCommand.java
Line 126:         return getParameters().getDiskImage();
Line 127:     }
Line 128: 
Line 129:     @Override
Line 130:     protected boolean canDoAction() {
any need to check available storage space?
Line 131:         getDiskImage();
Line 132:         return true;
Line 133:     }


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCopyTaskHandler.java
Line 103:         revertTask();
Line 104:     }
Line 105: 
Line 106:     @Override
Line 107:     protected VDSCommandType getRevertVDSCommandType() {
reminder: remove the VDSCommandType and just return null (perform rollback from 
previous task handler).
Line 108:         return VDSCommandType.DeleteImageGroup;
Line 109:     }
Line 110: 
Line 111:     @Override


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportRepoImageCreateTaskHandler.java
Line 67:             if (vdcReturnValue.getActionReturnValue() != null) {
Line 68:                 DiskImage newDiskImage = (DiskImage) 
vdcReturnValue.getActionReturnValue();
Line 69:                 
enclosingCommand.getParameters().setDestinationImageId(newDiskImage.getImageId());
Line 70: 
Line 71:                 /* NullPointer Exception
* setCurrentUser is done in CommandBase (i.e. it should be available in the 
enclosingCommand). Try to extract these lines to a method in 
ImportRepoImageCommand invoke it here.
* Also, see my comment in line 94.
Line 72:                 permissions perms = new 
permissions(getCurrentUser().getUserId(),
Line 73:                         PredefinedRoles.DISK_OPERATOR.getId(), 
diskImage.getId(), VdcObjectType.Disk);
Line 74:                 MultiLevelAdministrationHandler.addPermission(perms);
Line 75:                 */


Line 90: 
Line 91:     protected AddImageFromScratchParameters 
getAddImageFromScratchParameters() {
Line 92:         AddImageFromScratchParameters parameters = new 
AddImageFromScratchParameters(
Line 93:                 Guid.Empty, null, 
enclosingCommand.getParameters().getDiskImage());
Line 94:         
parameters.setStoragePoolId(enclosingCommand.getParameters().getStoragePoolId());
For setting 'currentUser', the 'sessionId' is needed.
I.e., add:
parameters.setSessionId(enclosingCommand.getParameters().getSessionId());
Line 95:         
parameters.setStorageDomainId(enclosingCommand.getParameters().getStorageDomainId());
Line 96:         
parameters.setImageGroupID(enclosingCommand.getParameters().getImageGroupID());
Line 97:         
parameters.setQuotaId(enclosingCommand.getParameters().getQuotaId());
Line 98:         parameters.setParentCommand(VdcActionType.ImportRepoImage);


Line 119:                 removeImageParams,
Line 120:                 ExecutionHandler.createInternalJobContext());
Line 121: 
Line 122:         
ExecutionHandler.setAsyncJob(enclosingCommand.getExecutionContext(), true);
Line 123:         enclosingCommand.getReturnValue().setSucceeded(true);
reminder: use DeleteImageGroup and extract to revertTask.
Line 124:     }
Line 125: 
Line 126:     @Override
Line 127:     public AsyncTaskType getTaskType() {


....................................................
File 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/ImportRepoImageParameters.java
Line 2: 
Line 3: import org.ovirt.engine.core.common.businessentities.DiskImage;
Line 4: import org.ovirt.engine.core.compat.Guid;
Line 5: 
Line 6: public class ImportRepoImageParameters extends 
ImagesActionsParametersBase {
is it used from the UI? if yes, you should probably add default ctr (for 
gwt-rpc serialization) - just check if it works fine in web-mode...
Line 7: 
Line 8:     private static final long serialVersionUID = 8168949491104775480L;
Line 9: 
Line 10:     private String sourceRepoImageId;


Line 8:     private static final long serialVersionUID = 8168949491104775480L;
Line 9: 
Line 10:     private String sourceRepoImageId;
Line 11: 
Line 12:     private DiskImage diskImage;
isn't it sufficient to pass the id?
Line 13: 
Line 14:     private Guid sourceStorageDomainId;
Line 15: 
Line 16:     public String getSourceRepoImageId() {


-- 
To view, visit http://gerrit.ovirt.org/16082
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I6b3e9497b633bd2ad32b896aea0aaab80634f2a7
Gerrit-PatchSet: 2
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: Liron Ar <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to