Alissa Bonas has uploaded a new change for review. Change subject: core: WIP add canDoAction to remove storage conn ......................................................................
core: WIP add canDoAction to remove storage conn Work in progress... Add canDoAction validations before removing a storage connection that there are no storage domains nor lun disks using that connection. Also add corresponding unitests. Change-Id: Ib7a633b06195a7b8ca1cd4fc5023c05010a3161d Signed-off-by: Alissa Bonas <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java A backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommandTest.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 9 files changed, 377 insertions(+), 19 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/69/15269/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java index 1efe351..a49e366 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java @@ -1,16 +1,24 @@ package org.ovirt.engine.core.bll.storage; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + import org.apache.commons.lang.StringUtils; import org.ovirt.engine.core.bll.LockIdNameAttribute; import org.ovirt.engine.core.bll.LockMessagesMatchUtil; import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute; import org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase; +import org.ovirt.engine.core.common.businessentities.LUNs; +import org.ovirt.engine.core.common.businessentities.StorageDomain; +import org.ovirt.engine.core.common.businessentities.StorageServerConnections; +import org.ovirt.engine.core.common.businessentities.StorageType; import org.ovirt.engine.core.common.locks.LockingGroup; import org.ovirt.engine.core.common.utils.Pair; import org.ovirt.engine.core.dal.VdcBllMessages; - -import java.util.Collections; -import java.util.Map; +import org.ovirt.engine.core.dao.LunDAO; +import org.ovirt.engine.core.dao.StorageServerConnectionDAO; @NonTransactiveCommandAttribute @LockIdNameAttribute @@ -21,15 +29,109 @@ } @Override - protected void executeCommand() { + protected boolean canDoAction() { String connectionId = getConnection().getid(); - if(StringUtils.isNotEmpty(connectionId)) { - getDbFacade().getStorageServerConnectionDao().remove(connectionId); + List<StorageDomain> domains = new ArrayList<>(); + if(StringUtils.isEmpty(connectionId) ) { + return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY); + } + StorageServerConnections connection = getStorageServerConnectionDao().get(connectionId); + StorageType storageType = connection.getstorage_type(); + if(storageType.isFileDomain()) { + //go to storage domain static, get all storage domains where storage field = storage connection id + domains = getStorageDomainsByConnId(connectionId); + if(domains.size() > 0) { + String domainNames = createDomainNamesListFromStorageDomains(domains); + return prepareFailureMessageForDomains(domainNames); + } + } + else if(storageType.equals(StorageType.ISCSI)) { + List<String> domainNames = new ArrayList<>(); + List<String> diskNames = new ArrayList<>(); + //go to luns to storage connections map table, get it from there + List<LUNs> luns = getLunDao().getAllForStorageServerConnection(connectionId); + if(luns.size() > 0) { + String volumeGroupId = null; + for(LUNs lun : luns) { + volumeGroupId = lun.getvolume_group_id(); + if(StringUtils.isNotEmpty(volumeGroupId)) { + // non empty vg id indicates there's a storage domain using the lun + String domainName = lun.getStorageDomainName(); + domainNames.add(domainName); + } + else { + //empty vg id indicates there's a lun disk using the lun + String lunDiskName = lun.getDiskAlias(); + diskNames.add(lunDiskName); + } + } + String domainNamesForMessage = null; + if(domainNames.size() > 0 ) { + // Build domain names list to display in the error + domainNamesForMessage = prepareEntityNamesForMessage(domainNames); + if(diskNames.size() < 1) { + return prepareFailureMessageForDomains(domainNamesForMessage) ; + } + else { + String diskNamesForMessage = prepareEntityNamesForMessage(diskNames); + return prepareFailureMessageForDomainsAndDisks(domainNamesForMessage,diskNamesForMessage); + } + } + else if(diskNames.size() > 0 ) { + String diskNamesForMessage = prepareEntityNamesForMessage(diskNames); + return prepareFailureMessageForDisks(diskNamesForMessage); + + } + else { + //todo ? + } + + + } + + } + //todo what about FC - how its connection looks like? + return true; } - //disconnect the connection from vdsm + protected StorageServerConnectionDAO getStorageServerConnectionDao() { + return getDbFacade().getStorageServerConnectionDao(); + } + + private String prepareEntityNamesForMessage(List<String> entityNames) { + StringBuilder domainNamesForMessage = new StringBuilder(); + for (String domainName : entityNames) { + domainNamesForMessage.append(domainName); + domainNamesForMessage.append(","); + } + // Remove the last "," after the last domain + domainNamesForMessage.deleteCharAt(domainNamesForMessage.length() - 1); + return domainNamesForMessage.toString(); + } + + @Override + protected void executeCommand() { + String connectionId = getConnection().getid(); + getStorageServerConnectionDao().remove(connectionId); + // disconnect the connection from vdsm disconnectStorage(); setSucceeded(true); + } + + protected boolean prepareFailureMessageForDomains(String domainNames) { + addCanDoActionMessage(String.format("$domainNames %1$s", domainNames)); + return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS); + } + + protected boolean prepareFailureMessageForDisks(String diskNames) { + addCanDoActionMessage(String.format("$diskNames %1$s", diskNames)); + return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL__DISKS); + } + + protected boolean prepareFailureMessageForDomainsAndDisks(String domainNames, String diskNames) { + addCanDoActionMessage(String.format("$domainNames %1$s", domainNames)); + addCanDoActionMessage(String.format("$diskNames %1$s", diskNames)); + return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS_AND_DISKS); } @Override @@ -39,4 +141,25 @@ VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } + protected String createDomainNamesListFromStorageDomains(List<StorageDomain> domains) { + // Build domain names list to display in the error + StringBuilder domainNames = new StringBuilder(); + for (StorageDomain domain : domains) { + domainNames.append(domain.getStorageName()); + domainNames.append(","); + } + // Remove the last "," after the last domain + domainNames.deleteCharAt(domainNames.length() - 1); + return domainNames.toString(); + } + + protected LunDAO getLunDao() { + return getDbFacade().getLunDao(); + } + + @Override + protected void setActionMessageParameters() { + addCanDoActionMessage(VdcBllMessages.VAR__ACTION__REMOVE); + addCanDoActionMessage(VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN); + } } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java index 9af6d00..d2cb6f8 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StorageServerConnectionCommandBase.java @@ -7,7 +7,10 @@ import org.ovirt.engine.core.bll.utils.PermissionSubject; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase; +import org.ovirt.engine.core.common.businessentities.StorageDomain; import org.ovirt.engine.core.common.businessentities.StorageServerConnections; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.core.dao.StorageDomainDAO; public abstract class StorageServerConnectionCommandBase<T extends StorageServerConnectionParametersBase> extends StorageHandlingCommandBase<T> { @@ -25,4 +28,12 @@ VdcObjectType.System, getActionType().getActionGroup())); } + + protected StorageDomainDAO getStorageDomainDao() { + return getDbFacade().getStorageDomainDao(); + } + + protected List<StorageDomain> getStorageDomainsByConnId(String connectionId) { + return getStorageDomainDao().getAllByConnectionId(Guid.createGuidFromString(connectionId)); + } } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java index 48ff264..7646d96 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStorageServerConnectionCommand.java @@ -30,7 +30,6 @@ import org.ovirt.engine.core.common.vdscommands.VDSReturnValue; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dal.VdcBllMessages; -import org.ovirt.engine.core.dao.StorageDomainDAO; import org.ovirt.engine.core.dao.StorageDomainDynamicDAO; import org.ovirt.engine.core.dao.StoragePoolIsoMapDAO; import org.ovirt.engine.core.dao.StorageServerConnectionDAO; @@ -234,10 +233,6 @@ return newConnectionParametersForVdsm; } - protected StorageDomainDAO getStorageDomainDao() { - return getDbFacade().getStorageDomainDao(); - } - protected StorageServerConnectionDAO getStorageConnDao() { return getDbFacade().getStorageServerConnectionDao(); } @@ -250,9 +245,7 @@ return getDbFacade().getStoragePoolIsoMapDao(); } - protected List<StorageDomain> getStorageDomainsByConnId(String connectionId) { - return getStorageDomainDao().getAllByConnectionId(Guid.createGuidFromString(connectionId)); - } + @Override protected Map<String, Pair<String, String>> getExclusiveLocks() { diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommandTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommandTest.java new file mode 100644 index 0000000..4f422fe --- /dev/null +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommandTest.java @@ -0,0 +1,210 @@ +package org.ovirt.engine.core.bll.storage; + +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.runners.MockitoJUnitRunner; +import org.ovirt.engine.core.bll.CanDoActionTestUtils; +import org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase; +import org.ovirt.engine.core.common.businessentities.LUNs; +import org.ovirt.engine.core.common.businessentities.NfsVersion; +import org.ovirt.engine.core.common.businessentities.StorageDomain; +import org.ovirt.engine.core.common.businessentities.StorageDomainStatus; +import org.ovirt.engine.core.common.businessentities.StorageServerConnections; +import org.ovirt.engine.core.common.businessentities.StorageType; +import org.ovirt.engine.core.compat.Guid; +import org.ovirt.engine.core.dal.VdcBllMessages; +import org.ovirt.engine.core.dao.LunDAO; +import org.ovirt.engine.core.dao.StorageServerConnectionDAO; +import org.ovirt.engine.core.utils.MockEJBStrategyRule; + +import java.util.ArrayList; +import java.util.List; + +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.when; + +@RunWith(MockitoJUnitRunner.class) +public class RemoveStorageServerConnectionCommandTest { + @ClassRule + public static MockEJBStrategyRule ejbRule = new MockEJBStrategyRule(); + + private RemoveStorageServerConnectionCommand command = null; + + private StorageServerConnections NFSConnection = null; + private StorageServerConnections IscsiConnection = null; + + @Mock + private LunDAO lunDAO; + + @Mock + private StorageServerConnectionDAO storageServerConnectionDAO; + + private StorageServerConnectionParametersBase parameters; + + @Before + public void prepareParams() { + + NFSConnection = + createNFSConnection( + "multipass.my.domain.tlv.company.com:/export/allstorage/data1", + StorageType.NFS, + NfsVersion.V4, + 50, + 0); + + IscsiConnection = + createIscsiConnection( + "10.11.12.225", + StorageType.ISCSI, + "iqn.2013-04.myhat.com:abc-target1", + "user1", + "mypassword", + "1"); + + prepareCommand(); + } + + private void prepareCommand() { + parameters = new StorageServerConnectionParametersBase(); + parameters.setVdsId(Guid.NewGuid()); + parameters.setStoragePoolId(Guid.NewGuid()); + + command = spy(new RemoveStorageServerConnectionCommand(parameters)); + doReturn(lunDAO).when(command).getLunDao(); + doReturn(storageServerConnectionDAO).when(command).getStorageServerConnectionDao(); + } + + private StorageServerConnections createNFSConnection(String connection, + StorageType type, + NfsVersion version, + int timeout, + int retrans) { + Guid id = Guid.NewGuid(); + StorageServerConnections connectionDetails = populateBasicConnectionDetails(id, connection, type); + connectionDetails.setNfsVersion(version); + connectionDetails.setNfsTimeo((short) timeout); + connectionDetails.setNfsRetrans((short) retrans); + return connectionDetails; + } + + private StorageServerConnections createIscsiConnection(String connection, + StorageType type , + String iqn, + String userName, + String password , + String portal + ) { + Guid id = Guid.NewGuid(); + StorageServerConnections connectionDetails = populateBasicConnectionDetails(id, connection, type); + connectionDetails.setiqn(iqn); + connectionDetails.setuser_name(userName); + connectionDetails.setpassword(password); + connectionDetails.setportal(portal); + return connectionDetails; + } + + private StorageServerConnections populateBasicConnectionDetails(Guid id, String connection, StorageType type) { + StorageServerConnections connectionDetails = new StorageServerConnections(); + connectionDetails.setid(id.toString()); + connectionDetails.setconnection(connection); + connectionDetails.setstorage_type(type); + return connectionDetails; + } + + @Test + public void checkRemoveConnectionEmptyId() { + StorageServerConnections newNFSConnection = createNFSConnection( + "multipass.my.domain.tlv.company.com:/export/allstorage/data2", + StorageType.NFS, + NfsVersion.V4, + 300, + 0); + newNFSConnection.setid(""); + parameters.setStorageServerConnection(newNFSConnection); + CanDoActionTestUtils.runAndAssertCanDoActionFailure(command,VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY); + } + + @Test + public void checkRemoveNFSConnectionDomainsExist() { + parameters.setStorageServerConnection(NFSConnection); + when(storageServerConnectionDAO.get(NFSConnection.getid())).thenReturn(NFSConnection); + List<StorageDomain> domains = new ArrayList<StorageDomain>(); + StorageDomain domain1 = new StorageDomain(); + domain1.setStorage(NFSConnection.getconnection()); + domain1.setStatus(StorageDomainStatus.Active); + domain1.setStorageName("domain1"); + StorageDomain domain2 = new StorageDomain(); + domain2.setStorage(NFSConnection.getconnection()); + domain2.setStatus(StorageDomainStatus.Maintenance); + domain2.setStorageName("domain2"); + domains.add(domain1); + domains.add(domain2); + doReturn(domains).when(command).getStorageDomainsByConnId(NFSConnection.getid()); + CanDoActionTestUtils.runAndAssertCanDoActionFailure(command, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS); + } + + @Test + public void checkRemoveNFSConnectionNoDomain() { + parameters.setStorageServerConnection(NFSConnection); + when(storageServerConnectionDAO.get(NFSConnection.getid())).thenReturn(NFSConnection); + List<StorageDomain> domains = new ArrayList<StorageDomain>(); + doReturn(domains).when(command).getStorageDomainsByConnId(NFSConnection.getid()); + CanDoActionTestUtils.runAndAssertCanDoActionSuccess(command); + } + + @Test + public void checkRemoveIscsiConnectionDomainsExist() { + parameters.setStorageServerConnection(IscsiConnection); + when(storageServerConnectionDAO.get(IscsiConnection.getid())).thenReturn(IscsiConnection); + List<LUNs> luns = new ArrayList<LUNs>(); + LUNs lun1 = new LUNs(); + lun1.setLUN_id("3600144f09dbd05000000517e730b1212"); + lun1.setStorageDomainName("storagedomain1"); + lun1.setvolume_group_id("G95OWd-Wvck-vftu-pMq9-9SAC-NF3E-ulDPsQ"); + luns.add(lun1); + when(lunDAO.getAllForStorageServerConnection(IscsiConnection.getid())).thenReturn(luns); + CanDoActionTestUtils.runAndAssertCanDoActionFailure(command, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS); + } + + @Test + public void checkRemoveIscsiConnectionDomainsAndDisksExist() { + parameters.setStorageServerConnection(IscsiConnection); + when(storageServerConnectionDAO.get(IscsiConnection.getid())).thenReturn(IscsiConnection); + List<LUNs> luns = new ArrayList<LUNs>(); + LUNs lun1 = new LUNs(); + lun1.setLUN_id("3600144f09dbd05000000517e730b1212"); + lun1.setStorageDomainName("storagedomain1"); + lun1.setvolume_group_id("G95OWd-Wvck-vftu-pMq9-9SAC-NF3E-ulDPsQ"); + luns.add(lun1); + LUNs lun2 = new LUNs(); + lun2.setLUN_id("3600144f09dbd05000000517e730b1212"); + lun2.setStorageDomainName(""); + lun2.setvolume_group_id(""); + lun2.setDiskAlias("disk2"); + luns.add(lun2); + when(lunDAO.getAllForStorageServerConnection(IscsiConnection.getid())).thenReturn(luns); + CanDoActionTestUtils.runAndAssertCanDoActionFailure(command, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS_AND_DISKS); + } + + @Test + public void checkRemoveIscsiConnectionDisksExist() { + parameters.setStorageServerConnection(IscsiConnection); + when(storageServerConnectionDAO.get(IscsiConnection.getid())).thenReturn(IscsiConnection); + List<LUNs> luns = new ArrayList<LUNs>(); + LUNs lun1 = new LUNs(); + lun1.setLUN_id("3600144f09dbd05000000517e730b1212"); + lun1.setStorageDomainName("storagedomain1"); + lun1.setvolume_group_id(""); + lun1.setDiskAlias("disk1"); + luns.add(lun1); + when(lunDAO.getAllForStorageServerConnection(IscsiConnection.getid())).thenReturn(luns); + CanDoActionTestUtils.runAndAssertCanDoActionFailure(command, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL__DISKS); + } + + + +} diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java index 7831525..d695e14 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java @@ -449,9 +449,12 @@ ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST, ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST, ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST, + ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY, ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS, ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE, ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS, + ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS_AND_DISKS, + ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL__DISKS, ACTION_TYPE_FAILED_STORAGE_CONNECTION_WRONG_PARAMETERS_FOR_STORAGE_TYPE, ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE, ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL, diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index 38ae384..fdf6e46 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -341,9 +341,12 @@ ACTION_TYPE_FAILED_NAME_ALREADY_USED=Cannot ${action} ${type}. The ${type} name is already in use, please choose a unique name and try again. ACTION_TYPE_FAILED_URL_INVALID=Cannot ${action} ${type}. The URL is not valid, please enter a valid URL and try again. ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST=Cannot ${action} ${type}. Storage connection doesn't exist. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY=Cannot ${action} ${type}. Storage connection id is empty. ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS=Cannot ${action} ${type}. Storage connection already exists. ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE=Cannot ${action} ${type}. Storage connection parameters can be edited only for NFS data domains in maintenance. -ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS=Cannot ${action} ${type}. Storage connection parameters are related to more than one storage domain : ${domainNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS=Cannot ${action} ${type}. Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS_AND_DISKS=Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames} and disks: ${diskNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL__DISKS=Cannot ${action} ${type}. Storage connection parameters are related to the following disks : ${diskNames}. ACTION_TYPE_FAILED_STORAGE_CONNECTION_WRONG_PARAMETERS_FOR_STORAGE_TYPE=Cannot ${action} ${type}. Connection parameters are invalid for this storage type. ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE=Cannot ${action} ${type}. Storage type cannot be edited. ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST=Cannot ${action} ${type}. Storage Domain doesn't exist. diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index ff3e828..cd8eff9 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -952,15 +952,24 @@ @DefaultStringValue("Cannot ${action} ${type}. Storage connection doesn't exist.") String ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST(); + @DefaultStringValue("Cannot ${action} ${type}. Storage connection id is empty.") + String ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY(); + @DefaultStringValue("Cannot ${action} ${type}. Storage connection already exists.") String ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS(); @DefaultStringValue("Cannot ${action} ${type}. Storage connection parameters can be edited only for NFS data domains in maintenance.") String ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE(); - @DefaultStringValue("Cannot ${action} ${type}. Storage connection parameters are related to more than one storage domain") + @DefaultStringValue("Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames}.") String ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS(); + @DefaultStringValue("Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames} and disks: ${diskNames}.") + String ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS_AND_DISKS(); + + @DefaultStringValue("Cannot ${action} ${type}. Storage connection parameters are related to the following disks : ${diskNames}.") + String ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL__DISKS(); + @DefaultStringValue("Cannot ${action} ${type}. Connection parameters are invalid for this storage type.") String ACTION_TYPE_FAILED_STORAGE_CONNECTION_WRONG_PARAMETERS_FOR_STORAGE_TYPE(); diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index 1492327..93feefe 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -338,9 +338,12 @@ VALIDATION_VDS_CONSOLEADDRESSS_HOSTNAME_OR_IP=Console address must be a FQDN or a valid IP address ACTION_TYPE_FAILED_URL_INVALID=Cannot ${action} ${type}. The URL is not valid, please enter a valid URL and try again. ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST=Cannot ${action} ${type}. Storage connection doesn't exist. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY=Cannot ${action} ${type}. Storage connection id is empty. ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS=Cannot ${action} ${type}. Storage connection already exists. ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE=Cannot ${action} ${type}. Storage connection parameters can be edited only for NFS data domains in maintenance. -ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS=Cannot ${action} ${type}. Storage connection parameters are related to more than one storage domain : ${domainNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS=Cannot ${action} ${type}. Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS_AND_DISKS=Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames} and disks: ${diskNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL__DISKS=Cannot ${action} ${type}. Storage connection parameters are related to the following disks : ${diskNames}. ACTION_TYPE_FAILED_STORAGE_CONNECTION_WRONG_PARAMETERS_FOR_STORAGE_TYPE=Cannot ${action} ${type}. Connection parameters are invalid for this storage type. ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE=Cannot ${action} ${type}. Storage type cannot be edited. ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST=Cannot ${action} ${type}. Storage Domain doesn't exist. diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index b6e768d..b693654 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -345,9 +345,12 @@ VALIDATION_VDS_CONSOLEADDRESSS_HOSTNAME_OR_IP=Console address must be a FQDN or a valid IP address ACTION_TYPE_FAILED_URL_INVALID=Cannot ${action} ${type}. The URL is not valid, please enter a valid URL and try again. ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST=Cannot ${action} ${type}. Storage connection doesn't exist. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_ID_EMPTY=Cannot ${action} ${type}. Storage connection id is empty. ACTION_TYPE_FAILED_STORAGE_CONNECTION_ALREADY_EXISTS=Cannot ${action} ${type}. Storage connection already exists. ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_FOR_STORAGE=Cannot ${action} ${type}. Storage connection parameters can be edited only for NFS data domains in maintenance. -ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS=Cannot ${action} ${type}. Storage connection parameters are related to more than one storage domain : ${domainNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS=Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL_STORAGE_DOMAINS_AND_DISKS=Cannot ${action} ${type}. Storage connection parameters are related to the following storage domains : ${domainNames} and disks: ${diskNames}. +ACTION_TYPE_FAILED_STORAGE_CONNECTION_BELONGS_TO_SEVERAL__DISKS=Cannot ${action} ${type}. Storage connection parameters are related to the following disks : ${diskNames}. ACTION_TYPE_FAILED_STORAGE_CONNECTION_WRONG_PARAMETERS_FOR_STORAGE_TYPE=Cannot ${action} ${type}. Connection parameters are invalid for this storage type. ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_CHANGE_STORAGE_TYPE=Cannot ${action} ${type}. Storage type cannot be edited. ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST=Cannot ${action} ${type}. Storage Domain doesn't exist. -- To view, visit http://gerrit.ovirt.org/15269 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7a633b06195a7b8ca1cd4fc5023c05010a3161d Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Alissa Bonas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
