Allon Mureinik has posted comments on this change.
Change subject: core: LUNs validation on storage creation
......................................................................
Patch Set 1:
(2 comments)
@Daniel - see comments inline.
@Cheryn - can you please take a look at the changes in
backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties ?
@Both - I'd love to come up with a message that somehow shows WHAT these LUNs
are a part of.
Any suggestions?
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageDomainCommandBase.java
Line 219:
Line 220: protected boolean isLunsAlreadyPartOfStorageDomains(List<String>
lunIds) {
Line 221: // Get LUNs from DB
Line 222: List<LUNs> lunsFromDb = getLunDao().getAll();
Line 223: List<String> existingLunIds = new ArrayList<>();
performance: use a HashSet
Line 224:
Line 225: for (LUNs lun : lunsFromDb) {
Line 226: if (lunIds.contains(lun.getLUN_id()) &&
lun.getStorageDomainId() != null) {
Line 227: // LUN is already part of a storage domain
Line 222: List<LUNs> lunsFromDb = getLunDao().getAll();
Line 223: List<String> existingLunIds = new ArrayList<>();
Line 224:
Line 225: for (LUNs lun : lunsFromDb) {
Line 226: if (lunIds.contains(lun.getLUN_id()) &&
lun.getStorageDomainId() != null) {
wouldn't we also want to check if this LUN is used as a Direct LUN?
Line 227: // LUN is already part of a storage domain
Line 228: existingLunIds.add(lun.getLUN_id());
Line 229: }
Line 230: }
--
To view, visit http://gerrit.ovirt.org/19633
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia39a19374169fce20850b187a6d4201ff34ef0d8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Cheryn Tan <[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