Daniel Erez has posted comments on this change.

Change subject: webadmin: block operations on ovf disks
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.ovirt.org/#/c/23566/4/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/disks/DiskListModel.java
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/disks/DiskListModel.java:

Line 503:         Disk disk = (Disk) getSelectedItem();
Line 504:         ArrayList<Disk> disks = getSelectedItems() != null ? 
(ArrayList<Disk>) getSelectedItems() : null;
Line 505:         boolean shouldAllow = true;
Line 506:         if (disk != null) {
Line 507:             shouldAllow = !disk.isOvfStore() && 
!(disk.getDiskStorageType() == DiskStorageType.IMAGE &&
> I don't think that we should keep it atm.
I just think that 'shouldAllow' is a too generic flag here as it's currently 
used only for the edit command. If we change it to something like 
'shouldAllowEdit' it'll be too specific and un-reusable. Hence, keeping the 
granularity might be the best approach here for future changes. To overcome the 
redundant type check, we can extract to methods, i.e. '!isOvfDisk && 
!isDiskLocked(disk)' - though not too crucial in my view...
Line 508:                     ((DiskImage) disk).getImageStatus() == 
ImageStatus.LOCKED);
Line 509:         }
Line 510: 
Line 511:         getNewCommand().setIsExecutionAllowed(true);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I379d10be9b6ee1cbda99d85f5dc02af78695a65c
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Tal Nisan <[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

Reply via email to