Allon Mureinik has posted comments on this change.
Change subject: core: add ability edit NFS path in webadmin
......................................................................
Patch Set 9: Looks good to me, but someone else must approve
(5 inline comments)
some minor comments/questions, see inline - mainly around the relationship
between connection and domain
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java
Line 10: import java.util.Collections;
Line 11: import java.util.Map;
Line 12:
Line 13: @NonTransactiveCommandAttribute
Line 14: @LockIdNameAttribute(isReleaseAtEndOfExecute = true)
true is the default, I think you can omit this param, also it's a matter of
taste.
Line 15: public class RemoveStorageServerConnectionCommand<T extends
StorageServerConnectionParametersBase> extends
DisconnectStorageServerConnectionCommand {
Line 16:
Line 17: public RemoveStorageServerConnectionCommand(T parameters) {
Line 18: super(parameters);
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java
Line 79: }
Line 80: }
Line 81:
Line 82: if(domains == null) {
Line 83: domains =
getStorageDomainsByConnId(newConnectionDetails.getid());
Why not just make this method a lazy getter.
Line 84: }
Line 85: if(domains.isEmpty()) {
Line 86: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST);
Line 87: }
Line 81:
Line 82: if(domains == null) {
Line 83: domains =
getStorageDomainsByConnId(newConnectionDetails.getid());
Line 84: }
Line 85: if(domains.isEmpty()) {
see Ayal's comment in patchset #7 - are we sure we want to fail in this
situation?
Line 86: return
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST);
Line 87: }
Line 88: else if(domains.size() == 1) {
Line 89: setStorageDomain(domains.get(0));
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)
This would look better with storageDomain.getStorageDomainType().isData(), IMHO
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);
Why assume there's just one domain here?
why not just lock 'em all?
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