Maor Lipchuk has uploaded a new change for review.

Change subject: core: Set read only in the CDA instead the constructor
......................................................................

core: Set read only in the CDA instead the constructor

Setting read only property in the disk at the CDA phase in the constructor to 
avoid NPE
when there is no disk in the DB.

Change-Id: Ib70637b4fc29a95bb73aa57a6f3f0c74d4d16ca1
Signed-off-by: Maor Lipchuk <mlipc...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/15/31115/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
index a20cbed..05ef134 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AttachDiskToVmCommand.java
@@ -50,7 +50,6 @@
     public AttachDiskToVmCommand(T parameters, CommandContext commandContext) {
         super(parameters, commandContext);
         disk = loadDisk((Guid) getParameters().getEntityInfo().getId());
-        disk.setReadOnly(getParameters().isReadOnly());
     }
 
     @Override
@@ -64,6 +63,7 @@
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST);
         }
 
+        disk.setReadOnly(getParameters().isReadOnly());
         DiskValidator diskValidator = getDiskValidator(disk);
 
         if (!checkDiskUsedAsOvfStore(diskValidator)) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib70637b4fc29a95bb73aa57a6f3f0c74d4d16ca1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Maor Lipchuk <mlipc...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to