Allon Mureinik has posted comments on this change.
Change subject: core: add ability edit NFS path in webadmin
......................................................................
Patch Set 9: (2 inline comments)
Answered inline to Alissa's responses.
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java
Line 116: }
Line 117:
Line 118: protected boolean isConnectionEditable(StorageDomain
storageDomain) {
Line 119: boolean isEditable =
Line 120: (storageDomain.getStorageDomainType() ==
StorageDomainType.Data || storageDomain.getStorageDomainType() ==
StorageDomainType.Master)
protected List<StorageDomain> getStorageDomainsByConnId(String connectionId) {
if (myDataMember == null) {
myDataMember =
getStorageDomainDao().getAllByConnectionId(Guid.createGuidFromString(connectionId));
}
return myDataMember;
}
That way you don't need to muck around with null checks and dao calls in the
"business logic" method.
Line 121: && storageDomain.getStatus() ==
StorageDomainStatus.Maintenance;
Line 122: return isEditable;
Line 123: }
Line 124:
Line 236: Map<String, Pair<String, String>> locks = new HashMap<String,
Pair<String, String>>();
Line 237: domains =
getStorageDomainsByConnId(getParameters().getStorageServerConnection().getid());
Line 238: if(!domains.isEmpty() && domains.size() == 1) {
Line 239: setStorageDomain(domains.get(0));
Line 240: locks.put(getStorageDomain().getId().toString(),
LockMessagesMatchUtil.STORAGE);
1. You aren't supposed to fail CDA on something that isn't locked
2. looking forward, isn't this going to be generalized to more than NFS?
Line 241: }
Line 242: // lock the path to NFS to avoid at the same time if some
other user tries to:
Line 243: // add new storage domain to same path or edit another
storage server connection to point to same path
Line 244:
locks.put(getParameters().getStorageServerConnection().getconnection(),
--
To view, visit http://gerrit.ovirt.org/12372
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ifaff5344ff191d6bdf53cc706c7bb796167a56b3
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Tal Nisan <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches