Allon Mureinik has uploaded a new change for review. Change subject: core: CommonPoolWithVms.isVmPoolNameValidLength ......................................................................
core: CommonPoolWithVms.isVmPoolNameValidLength Patch 540a75e0f7bc4b9ed879471d3d830d575c6d6060 removed the last usage of CommonVmsPoolWithVmsCommand.isVmPoolNameValidLength(String), so now this method should be removed too. Instead, use VmCommand.isVmNameValidLength(VM). Change-Id: Ide5f59bf24cf2562a0cd69f97bc4224a4660e556 Signed-off-by: Allon Mureinik <amure...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java 1 file changed, 0 insertions(+), 33 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/21667/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java index 747e101..1481357 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java @@ -31,8 +31,6 @@ import org.ovirt.engine.core.common.errors.VdcBllMessages; import org.ovirt.engine.core.common.job.Step; import org.ovirt.engine.core.common.job.StepEnum; -import org.ovirt.engine.core.common.osinfo.OsRepository; -import org.ovirt.engine.core.common.utils.SimpleDependecyInjector; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector; import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase; @@ -56,7 +54,6 @@ protected Map<Guid, List<DiskImage>> storageToDisksMap; protected Map<Guid, StorageDomain> destStorages = new HashMap<Guid, StorageDomain>(); private boolean _addVmsSucceded = true; - private OsRepository osRepository = SimpleDependecyInjector.getInstance().get(OsRepository.class); /** * Constructor for command creation when compensation is applied on startup @@ -335,36 +332,6 @@ protected boolean getAddVmsSucceded() { return _addVmsSucceded; - } - - /** - * Check if the name of the VM-Pool has valid length, meaning it's not too long. - * Since VMs in a pool are named like: 'SomePool_22', the max length allowed for the name is the max VM-name length - * + room for the suffix: <Max Length of VM name> - (length(<MaxVmsInPool>) + 1) - * In deciding the max length for a VM name, take into consideration if it's a Windows or non-Windows VM - * @param vmPoolName - * name of pool - * @return true if name has valid length; false if the name is too long - */ - protected boolean isVmPoolNameValidLength(String vmPoolName) { - - // get VM-pool OS type - int osId = getParameters().getVmStaticData().getOsId(); - - // determine the max length considering the OS and the max-VMs-in-pool - // get the max VM name (configuration parameter) - int maxVmNameLengthWindows = Config.<Integer> GetValue(ConfigValues.MaxVmNameLengthWindows); - int maxVmNameLengthNonWindows = Config.<Integer> GetValue(ConfigValues.MaxVmNameLengthNonWindows); - - int maxLength = osRepository.isWindows(osId) ? maxVmNameLengthWindows : maxVmNameLengthNonWindows; - Integer maxVmsInPool = Config.GetValue(ConfigValues.MaxVmsInPool); - maxLength -= (String.valueOf(maxVmsInPool).length() + 1); - - // check if name is valid - boolean nameLengthValid = (vmPoolName.length() <= maxLength); - - // return the result - return nameLengthValid; } public String getVmsCount() { -- To view, visit http://gerrit.ovirt.org/21667 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide5f59bf24cf2562a0cd69f97bc4224a4660e556 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <amure...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches