Alissa Bonas has posted comments on this change. Change subject: core: add ability edit NFS path in webadmin ......................................................................
Patch Set 9: (5 inline comments) .................................................... 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) yes I know - it's the default and it can be omitted, just thought it would be more clear to explicitly write it. 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()); What do you mean by 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()) { Yes I saw Ayal's comment on #7 - I didn't find any option in REST to create just a connection without domain. The connection addition is done in private method called from flow that adds a storage domain (or checks if domain already exists) . So it is always bounded to domain. (unless there are some bugs there related to domain creation...) If you are familiar with an additional flow - please let me know. 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) Lets agree to disagree :) I think this is more clear. 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); Because domain-connection for NFS is a 1:1 relationship. If there are several domains using same connection it's corrupted configuration IMHO and it will fail on that in canDoAction anyway. 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 <abo...@redhat.com> Gerrit-Reviewer: Alissa Bonas <abo...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@redhat.com> Gerrit-Reviewer: Daniel Erez <de...@redhat.com> Gerrit-Reviewer: Itamar Heim <ih...@redhat.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Tal Nisan <tni...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches